aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-12-02 11:54:07 -0800
committerAnthony Ramine <n.oxyde@gmail.com>2017-03-03 23:25:29 +0100
commit4e7ac19380d7c24cc60d010dd8a43e5b020c371d (patch)
tree1a422cee2706c1fddb440b3f279cec124e7ab182 /python/tidy/servo_tidy_tests
parent198662f8cbbffa53de5a9d036a77934a36102134 (diff)
downloadservo-4e7ac19380d7c24cc60d010dd8a43e5b020c371d.tar.gz
servo-4e7ac19380d7c24cc60d010dd8a43e5b020c371d.zip
script: Use a timer when rAF is used for non-animation purposes
After this patch, when the page calls `requestAnimationFrame()` too many times in the row without actually mutating the DOM, further calls to `rAF` will actually perform the moral equivalent of `setTimeout(16)`. This saves a lot of CPU time compared to actually waiting for the vertical blanking interval, because waiting for that requires us to draw the page. Reduces CPU usage drastically on nytimes.com, which has a perpetual `requestAnimationFrame()` loop that checks whether ads are in view.
Diffstat (limited to 'python/tidy/servo_tidy_tests')
0 files changed, 0 insertions, 0 deletions