Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10644 closed bug (worksforme)

jQuery performce issue in support function

Reported by: nkhanna@… Owned by: timmywil
Priority: high Milestone: 1.next
Component: support Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:


We are using jQuery 1.6.4 in few project at eBay and found that following line of code in jQuery.support takes around 100 ms in Firefox and IE:

support.boxModel = div.offsetWidth === 2;

if ( "zoom" in div.style ) { ...... }

Any suggestions how can this be improved or can it be fixed.

It is HTML5 page with <!DOCTYPE html>

Thanks Neeraj

Change History (11)

comment:1 Changed 10 years ago by dmethvin

Owner: set to nkhanna@…
Status: newpending

Interesting. How are you measuring the time it takes?

comment:2 Changed 10 years ago by Neeraj Khanna <nkhanna@…>

We are using "dynatrace" to check the execution time for each function and this turned out to be one of the biggest issue on our page, total execution is about 280 ms and 100 ms accounts for just this one line.

comment:3 Changed 10 years ago by anonymous

Run dyntrace against http://r1test.ebay.com/sch/i.html?_nkw=nike for Firefox

comment:4 Changed 10 years ago by dmethvin

Component: unfiledsupport
Milestone: None1.7.1
Priority: undecidedhigh
Status: pendingopen

We'll look into this for 1.7.1, we were planning to do some work there anyway. Thanks!

comment:5 Changed 10 years ago by Neeraj Khanna <nkhanna@…>


What is timeline for 1.7? In the meanwhile can you suggest a patch to fix this?

comment:6 Changed 10 years ago by timmywil

For now, you could change the line to:

if ( typeof div.style.zoom !== "undefined ) {

but we'll be doing extensive performance testing of support.js in 1.7.1

comment:7 Changed 10 years ago by timmywil

Owner: changed from nkhanna@… to timmywil
Status: openassigned

comment:8 Changed 10 years ago by Neeraj Khanna <nkhanna@…>

I apologize if I was not clear in my ticket, problem is in this line:

support.boxModel = div.offsetWidth === 2;

not in zoom.

I found the following thread in stackoverflow discussing the same thing, but the reason mentioned doesn't apply to our case as we have doctype for HTML5 on the page.


comment:9 Changed 10 years ago by timmywil

comment:10 Changed 10 years ago by Rick Waldron

Milestone: 1.7.11.next

comment:11 Changed 10 years ago by timmywil

Resolution: worksforme
Status: assignedclosed

Closing until this issue can be reproduced. Support has already undergone some changes.

Note: See TracTickets for help on using tickets.