-
Notifications
You must be signed in to change notification settings - Fork 514
Open
Labels
Milestone
Description
Hi everyone,
In modern web (or mobile) applications, setStyle can be called millions of times. It's, for me, the most crucial code for good lower level performance.
So, optimization ideas for the Element.setStyle function:
. remove the camelCase(). I've already done it in my version. Try it ! It's great :)
. remove the Math.round around 'val'. With retina screens, sub-pixels become real pixels
. (Element.Styles[property] || '@').split(' ') should be cached. Instead of Strings, Element.Styles values should be Arrays
. if the split array has a length of 1, we don't have to do a "Array.from(value)"
What do you think of it ?
Thx,
Olivier Allouch
http://www.illicotravel.com