Bug Tracker

Opened 10 years ago

Closed 9 years ago

#5011 closed enhancement (fixed)

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.

Change History (3)

comment:1 Changed 10 years ago by brimstone

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?

comment:2 Changed 10 years ago by mofle

Anyone want to make a test case for this?

comment:3 Changed 9 years ago by dmethvin

Resolution: fixed
Status: newclosed

This value is configurable in 1.4.3:

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

Note: See TracTickets for help on using tickets.