View Full Version : function getComputedStyle takes 82% CPU time

19 Jan 2010, 1:59 PM

We are trying to improve performance of our application which was
ported from GWT-EXT to GXT library. Opening a window with a grid is
noticeably slower with GXT for exactly same data.
Doing profiling we see 82% CPU time being spent inside getComputedStyle()
which is called only 41 times.

Is there a way to improve performance of this function or avoid calls to it?


19 Jan 2010, 2:07 PM
The function is slow because it depends heavily on the browsers engine, and that is slow. In FF everytime you want to get a computed style, it first calculates it. So this will take time. But the calls are needed inside the framework. If you dont have dynamic paddings/borders/margins, you could extend the widgets you use and harcode the values. So the browser wont need to calculate them for you.

21 Jan 2010, 1:49 PM
We do not use dynamic padding and margins. Can you please send an example
which methods and which classes do we need to override to avoid calls to getComputedStyle()?

Thanks a lot,