New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
div.offsetHeight takes long time at document ready with a big document #2324
Comments
Have you tried the most recent version? That code looks very different now and is performed on an as-needed basis. |
Hi, Do you refer to jquery 2.x version? We are using this version to be compatible with old browsers. |
Dave meant jQuery 1.11.3. Michał Gołębiowski |
Ok. Now I have tested with the latest version 1.11.3 and the problem is similar, in IE10 the call to div.offsetWidth takes 4.5 seconds. This is the line: support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; |
@rubenortizgonzalez Thank you for making us aware. Could you copy your test case into http://jsbin.com for us? |
Hi Timmy, it was impossible to copy a file of 3.3Megas into jsbin, I shared with you the file from this source: https://dl.dropboxusercontent.com/u/16911948/test.html The test.html file references a jquery 1.11.3 version modified with a print to console of the times of document ready functions. |
jQuery has to do various feature detects, some of which force layout and would be very expensive for a document of that size. The 3.0 version will have more of those taken out and done on a lazy basis I think, but really the best solution is to only load the HTML needed for the initial view and pull the rest in via |
Hi,
We are using jquery 1.8.2 and detected that with long documents (5 megas html) the method that is executed at document ready and calculates support.boxSizing, support.reliableHiddenOffsets, takes long time. It seems the calls to div.offsetX takes long time, one second in Chrome 42 and 10 seconds in IE10 (with a intel Core i5 in windows).
I marked the points with <-- HERE
Is there another way to calculate this with a better performance? Best regards.
// Run tests that need a body at doc ready
jQuery(function() {
var container, div, tds, marginDiv,
divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
body = document.getElementsByTagName("body")[0];
...
The text was updated successfully, but these errors were encountered: