Comment
Comment by blixt
The biggest performance bomb you can have in your code is a loop that does something like
This forces the browser to recalculate layout multiple times in a single frame. Separating layout changing code from measurement code will help a lot here (most frameworks out there have solved this so we don't have to be too concerned about it though).