Changes between Initial Version and Version 1 of Ticket #17515


Ignore:
Timestamp:
Oct 17, 2013, 10:20:42 PM (8 years ago)
Author:
bill
Comment:

I agree it's poor style, but OTOH acme.js is deprecated code and it should only be running on IE8. Otherwise dojo/query will use selector/lite rather than selector/acme. Which browser is the customer using?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17515

    • Property Owner set to Kris Zyp
    • Property Component changed from Core to Query
    • Property Type changed from defect to enhancement
  • Ticket #17515 – Description

    initial v1  
    11[reported by customer]
    22In dojo/selector/acme.js, in the _queryFuncCacheQSA function, we see the following code (we use version 1.8.3, but this code has not changed in the latest version, 1.9.x)
    3  
     3
     4{{{
    45try{
    56if(!((9 == root.nodeType) || nospace)){ throw ""; }
     
    1314return getQueryFunc(query, true)(root);
    1415}
    15  
     16}}}
     17
    1618This is using an exception to control flow, which apart from being poor style, is a definite performance no-no, and it noticeably impacts pages with many selectors.
    1719I changed the code in our app to eliminate the throw and this simple change makes a 10% difference (~150ms) in rendering the page, which is using selectors extensively. I can easily fix this in our source base, but it should be changed in Dojo, otherwise we’ll have to keep porting the change as we upgrade.