Skip to main content

Bug Tracker

Side navigation

#10644 closed bug (worksforme)

Opened November 02, 2011 10:15PM UTC

Closed November 18, 2011 09:03PM UTC

Last modified March 10, 2012 03:16AM UTC

jQuery performce issue in support function

Reported by: nkhanna@ebay.com 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

Attachments (0)
Change History (11)

Changed November 02, 2011 10:27PM UTC by dmethvin comment:1

owner: → nkhanna@ebay.com
status: newpending

Interesting. How are you measuring the time it takes?

Changed November 02, 2011 10:35PM UTC by Neeraj Khanna <nkhanna@ebay.com> comment:2

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.

Changed November 02, 2011 10:52PM UTC by anonymous comment:3

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

Changed November 02, 2011 11:02PM UTC by dmethvin comment:4

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!

Changed November 02, 2011 11:16PM UTC by Neeraj Khanna <nkhanna@ebay.com> comment:5

Thanks,

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

Changed November 03, 2011 02:45PM UTC by timmywil comment:6

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

Changed November 03, 2011 04:27PM UTC by timmywil comment:7

owner: nkhanna@ebay.comtimmywil
status: openassigned

Changed November 03, 2011 05:28PM UTC by Neeraj Khanna <nkhanna@ebay.com> comment:8

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

Changed November 03, 2011 06:49PM UTC by timmywil comment:9

I'm not able to reproduce. http://jsfiddle.net/timmywil/nLxmG/6/show

Changed November 14, 2011 05:14PM UTC by rwaldron comment:10

milestone: 1.7.11.next

Changed November 18, 2011 09:03PM UTC by timmywil comment:11

resolution: → worksforme
status: assignedclosed

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