Results 1 to 3 of 3

Thread: lookupReference() or down() for performance

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montreal, Canada
    Posts
    265
    Answers
    3

    Lightbulb Answered: lookupReference() or down() for performance

    Hello!

    I am not too sure how to measure performance ? In a viewController, what is faster/better between lookupReference and down?

    Code:
    myfunc function(){
    
    
    	var view this.getView(),
    	   button;
    	
    	button = this.lookupReference('mybutton');
    	button = view.down('mybutton');
    
    
    }

  2. It depends on how often you are using it, I'd always go with lookupReference (or the lookup shorthand method) as it's a cached version. The first call will do the lookup, subsequent lookups will pull from the cache meaning it will be faster. down, child, query will all do the lookup every time it's executed.

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    It depends on how often you are using it, I'd always go with lookupReference (or the lookup shorthand method) as it's a cached version. The first call will do the lookup, subsequent lookups will pull from the cache meaning it will be faster. down, child, query will all do the lookup every time it's executed.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montreal, Canada
    Posts
    265
    Answers
    3

    Default

    Thanks, make a lot of sense.

Similar Threads

  1. ComponentQuery and lookupReference together
    By josei in forum Ext 5: Q&A
    Replies: 4
    Last Post: 31 Jan 2016, 1:31 PM
  2. lookupReference Question
    By blomasky in forum Sencha Ext JS Q&A
    Replies: 9
    Last Post: 12 Mar 2015, 11:53 AM
  3. lookupReference
    By Chris Wallace in forum Ext 5: Q&A
    Replies: 7
    Last Post: 5 Mar 2015, 1:35 AM
  4. ViewController lookupReference()
    By dmifs in forum Ext 5: Q&A
    Replies: 5
    Last Post: 16 Sep 2014, 6:59 AM
  5. lookupReference not working
    By Urkman in forum Ext 5: Q&A
    Replies: 3
    Last Post: 9 Aug 2014, 6:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •