28 Jul 2012 7:23 AM #1
Too many events, avoid 'painted' at all costs
I found that most 'performance problems' are related to the 'painted' event:
Much better performance by using making components listen to 'show' or creating custom events. This seems to be related to the isPainted() --> dom.offsetParent calculation.
Just add a couple of console.debug() statements to Dispatcher.js or Controller.js and you'll start to see where things go wrong!
Too many events firing that do nothing and delay a simple dom.style.display = ''.
I have several patches / hacks to improve performance but oddly enough I have to pay to get access to the GIT or SVN repo? How does that work?
I've also created a lightweight Ext.DomContainer with xtype: 'dom' that triggers less events and more lightweight to use in the view / template.
28 Jul 2012 6:04 PM #2
I'm going from poor to unusable performance in chrome and now you've mentioned paint event I'm thinking maybe I added something like this recently. If I tap and drag to move a view down but it changes thebackground of one of my list items then it jerks and lags as though it's the event that killed it. Will take a deeper look tomorrow into what's being fired. What sort of stuff did you uncover yourself?
29 Jul 2012 5:46 AM #3
mmm I don't have any painted events for any of the components on my homepage. Removed shadows in 2.1b3 and it sped things up quite considerably.
I just changed 2.1b3 to 18.104.22.168 again and it's absolutely lightning fast in comparison.
What happened in 2.1b3 that made it run like crap on both iOS and Android/Android Chrome? Looking at the list of things it talks about improving performance for odd events but other bits have killed my app making it unusable.
29 Jul 2012 3:47 PM #4
I ended up using painted as I could get the show listener to fire with a extension (i.e. not adding a listener to a created object but defining a listener an extension ) see bug - http://www.sencha.com/forum/showthread.php?220301
What do you mean to many events? surely there is one painted event fired for the component the listener is registered on.
Can anyone else confirm this issue
30 Jul 2012 6:57 AM #5
30 Jul 2012 7:22 AM #6
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
This is a reason why painted is not listenable within the controller... performance.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
30 Jul 2012 7:23 AM #7