#10644 closed bug (worksforme)
jQuery performce issue in support function
Reported by: | Owned by: | timmywil | |
---|---|---|---|
Priority: | high | Milestone: | 1.next |
Component: | support | Version: | 1.6.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 11 years ago by
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 11 years ago by
Run dyntrace against http://r1test.ebay.com/sch/i.html?_nkw=nike for Firefox
comment:4 Changed 11 years ago by
Component: | unfiled → support |
---|---|
Milestone: | None → 1.7.1 |
Priority: | undecided → high |
Status: | pending → open |
We'll look into this for 1.7.1, we were planning to do some work there anyway. Thanks!
comment:5 Changed 11 years ago by
Thanks,
What is timeline for 1.7? In the meanwhile can you suggest a patch to fix this?
comment:6 Changed 11 years ago by
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 11 years ago by
Owner: | changed from [email protected]… to timmywil |
---|---|
Status: | open → assigned |
comment:8 Changed 11 years ago by
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.
http://stackoverflow.com/questions/6225664/jquery-div-offsetwidth-poor-perfomance
comment:9 Changed 11 years ago by
I'm not able to reproduce. http://jsfiddle.net/timmywil/nLxmG/6/show
comment:10 Changed 11 years ago by
Milestone: | 1.7.1 → 1.next |
---|
comment:11 Changed 11 years ago by
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
Closing until this issue can be reproduced. Support has already undergone some changes.
Interesting. How are you measuring the time it takes?