PDA

View Full Version : getComputedStyle() and Ext performance



fermo111
7 Oct 2007, 5:36 PM
I was doing some profiling tests and this is what I got clicking on the button in the Layout Dialog example:

Function Calls Percent Own Time Time
getStyle 726 27.36% 360.404ms 361.124ms
insertHtml 36 20.87% 274.851ms 278.614ms
getWidth 27 6.74% 88.817ms 94.163ms

726 calls to getStyle() might be a lot considering that getStyle calls getComputedStyle() which seems to be quite expensive (Firefox on Linux). Is the use of getStyle going to change in future versions of Ext. Are there any workarounds to diminish the impact of this call?

Thanks

Luca

tryanDLS
8 Oct 2007, 11:02 AM
I would suggest you search for threads containing the word performance (and maybe grid) - this has been discussed in several places.

fermo111
9 Oct 2007, 12:27 PM
tryanDLS, as you suggested I have searched the forum for the words you told, and also for getStyle and getComputedStyle. There are indeed threads related to the same problem but unfortunately they give no solution, or at least I couldn't find one.

Could you be more specific pointing me to the right thread?

Thanks

Luca