Unanswered: Performance consideration: refs vs componentquery

Unanswered: Performance consideration: refs vs componentquery

I was just wondering whether its always faster to use refs instead of using componentquery if you are only referencing the item a single time in a controller. I assume that refs use componentquery anyway, but I guess I'm asking whether any cpu cycles are saved by using refs as opposed to just using componentquery

Yes, refs do use ComponentQuery to lookup and starts at the top and works it's way down and finds all instances matching your selector and then uses the first. This can be bad performance depending how many components you have instantiated.

Another way is to start at a component and walk up/down to get the reference you are wanting. You can then set that instance as a property to reference whenever.