13 Apr 2012 5:03 PM #1
Unanswered: removeAll() vs removeAll(true) perf?
Basically, i just want to understand when it can be considered useful to/not-to destroy elements with the true parameter. In my app, if I updateWithRecord() a form and need to build it there (dynamic structure), so first i have to clear previous built form :
Considering that I can have a 10-item list (not a fixed-number but quite low) that will be rendered on itemtap as different forms (like one with dates, one with dates and textfields)... Should I destroy old elements with removeAll(true) when a new form has to be rendered? I'm trying to get the best perf.
There may be a lot of comings-and-goings. If i do not destroy, will they stack somewhere a overflow memory at some point??!
16 Apr 2012 4:46 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
If you want to reuse a component and keep it's state (data in form fields of a remove form or selection in a list) then not destroying the component could be used. There is of course ways around this to recreate a component.
Reusing isn't bad even if you have different uses for them. Creating new components does have a small perf hit so if you just want to update HTML then you could keep a component around and just update it's html.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.