PDA

View Full Version : Ext.ComponentQuery cache disabled?



Steffen Hiller
3 Oct 2012, 7:10 AM
Anybody know why in 2.1 Beta 3 (not sure since which version) the Ext.ComponentQuery cache is disabled? At least it seems so, since the following lines are commented in the query method:



// query = this.cache[selector];
// if (!query) {
// this.cache[selector] = query = this.parse(selector);
// }


I was just checking to see if there is any performance gain by using refs in the controller.
If one component is referenced more than once, it seems so, but if the Ext.ComponentQuery cache would work, there wouldn't be any benefit performance wise using refs in controllers, am I right?

mitchellsimoens
9 Oct 2012, 7:08 AM
Better perf would be to start from a root to resolve a component instead of using Ext.ComponentQuery.query as it starts from the beginning and will go through all levels to find matches.

This change was done way back in January also. Comment was only "Remove infinite cache in ComponentQuery."

Steffen Hiller
9 Oct 2012, 7:16 AM
Better perf would be to start from a root to resolve a component instead of using Ext.ComponentQuery.query as it starts from the beginning and will go through all levels to find matches.

This change was done way back in January also. Comment was only "Remove infinite cache in ComponentQuery."

Hmm 'infinite cache' sounds like it had a memory leak then.
Yeah, I know that of the root, but refs don't use a root either.