-
26 Oct 2011 12:48 AM #1
Component class change performance
Component class change performance
Hey,
I noticed that execution of addCls and removeCls on component is much slower on Sencha Touch 2.0 than 1.1. Everything would be ok, but on iPad 1st gen (and everything slower) it's affecting user experience (yes - there is a case where it's possible
).
It seems that you bind some 'events' on class change. So I'm wondering if this part of code is final and what was the reason of this change.
Regards,
Adam
-
29 Oct 2011 6:55 PM #2Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
Thanks Adam, will look into this. Performance is very important to us
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
2 Nov 2011 10:32 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Jul 2009
- Location
- Palo Alto, California
- Posts
- 469
- Vote Rating
- 9
I believe you're referring to performance of reflow / redraw as a consequence of toggling a class on an element, as opposed to performance of addCls / removeCls methods themselves. If that's the case we are aware of that (typically on iOS), possibly due to the major change in layout which relies entirely on pure CSS. This should be addressed in our next release.
Sencha Touch Lead Architect
-
3 Nov 2011 4:13 AM #4
Thank you guys for your answers.
In fact my problem was connected to unnecessary reflow, but I was distracted by small test I performed: I looped addCls and removeCls on the same component on Sencha Touch 1.1 and then 2.0 and used profiler to find out what was an execution time. It turns out that ST2.0 is slower, but is not an issue which can affect user experience (effect of slower add/removeCls is relatively small to repaint/reflow). So I was wrong. Refactoring my code helped, and it's very hard to find any difference from user point of view.
Thank you for your time, and sorry for false alarm.
Regards,
Adam
-
3 Nov 2011 11:21 AM #5Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
No problem, thanks for following up
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer


Reply With Quote