substance/reader — pull request #1 by jure (2014-01-03 11:35:56+00:00)
Title: Switch to requestAnimationFrame and cache document.headings globally. Di...

So there's a lot of things that could be done for performance of the Lens Reader. Using only these dirty hacks, the performance of the demo page: http://lens.elifesciences.org/00778/#toc/all went up by 100% (12 FPS -> 24+ FPS) on my late 2011 MacBook Pro with 16 GB of RAM, 2,2 GHz i7 and the AMD Radeon 6750M.

![elifelens](https://f.cloud.github.com/assets/238667/1838896/7b057f96-746a-11e3-9ff8-519a4bbee295.png)

I suggest we keep this PR open to find and fix more little performance issues and then merge that in. I'm positive this page should go up to 60 FPS without any major code changes - there's simply too much going on in the markActiveHeading and updateVisibleArea functions, forcing synchronous whole document layout and style recalculation (even multiple) for every scroll event.