Skip to main content

Bug Tracker

Side navigation

#5011 closed enhancement (fixed)

Opened August 04, 2009 03:13PM UTC

Closed November 15, 2010 04:14AM UTC

Lower the number of animation steps per second in jQuery FX

Reported by: m4rw3r Owned by:
Priority: major Milestone: 1.4
Component: effects Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

I'm having concerns with processing power when using the animate() method of jQuery.

I've checked the source (1.3.2) and found that the setInterval uses a time of 13 milliseconds.

This means that it will produce almost 76 frames per second for the animations.

Is there any special reason behind this? I've lowered the fps on a local copy to ~30 (33ms interval) and it works nicely and with a lot less processing power.

The human eye only needs around 25-30 images per second to experience it as a fluent transition, so I think it is overkill with 76.

PS. Line 4064 in the jQuery-1.3.2.js file, downloaded from the main page.

Attachments (0)
Change History (3)

Changed August 24, 2009 02:00PM UTC by brimstone comment:1

I have also noticed an increase in CPU usage/processing while animating a scrolling list. It happens on Firefox 3.5.2 on Windows using jQuery 1.3.2, works fine in IE6 surprisingly. During the animation, the CPU usage is about 60% on my machine, 100% on a coworker's machine. I took your suggestion and made a local copy and changed line 4064 to 33ms. The CPU usage when down to 25%, on my machine. Considering this is a continuous looping animation, 60% won't cut it. We'll have to test if 25% will do though.

This might be an issue in FF's implementation of setInterval. Which browser are you using?

Changed October 30, 2009 11:32PM UTC by mofle comment:2

Anyone want to make a test case for this?

Changed November 15, 2010 04:14AM UTC by dmethvin comment:3

resolution: → fixed
status: newclosed

This value is configurable in 1.4.3:

http://api.jquery.com/jQuery.fx.interval/