Skip to content
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

destroy function call takes up 35s - jQuery 3.1.1 #187

Open
Legends opened this issue Feb 13, 2017 · 0 comments
Open

destroy function call takes up 35s - jQuery 3.1.1 #187

Legends opened this issue Feb 13, 2017 · 0 comments

Comments

@Legends
Copy link

Legends commented Feb 13, 2017

This issue is tied to jQuery 3.1.1

This issue does not happen with jQuery 2.1.1 or at least it's not that recognizable.

Unfortunately I cannot reproduce it when using jsFiddle..., but what I know is, that when I change the jQuery version back to 2.1.1 it works again!

I have a SPA app, which uses sparkline.
I have a page 22 sparkline charts on page.
Before leaving this page, I call $(".sparkline").sparkline('destroy');

I spotted two operations that take a long time:

$(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || !$(this).parents('body').length

and

render.call(this);

I captured the time for each iteration for each of the two statements.
Both are increasing over time!

1
jquery.sparkline.js:1026 check: 4.154ms
jquery.sparkline.js:1042 render: 3.198ms
jquery.sparkline.js:963 2
jquery.sparkline.js:1026 check: 0.677ms
jquery.sparkline.js:1042 render: 2.403ms
jquery.sparkline.js:963 3
jquery.sparkline.js:1026 check: 0.585ms
jquery.sparkline.js:1042 render: 2.225ms
jquery.sparkline.js:963 4
jquery.sparkline.js:1026 check: 0.646ms
jquery.sparkline.js:1042 render: 3.343ms
jquery.sparkline.js:963 5
jquery.sparkline.js:1026 check: 488.873ms
jquery.sparkline.js:1042 render: 495.051ms
jquery.sparkline.js:963 6
jquery.sparkline.js:1026 check: 488.555ms
jquery.sparkline.js:1042 render: 491.088ms
jquery.sparkline.js:963 7
jquery.sparkline.js:1026 check: 490.381ms
jquery.sparkline.js:1042 render: 493.788ms
jquery.sparkline.js:963 8
jquery.sparkline.js:1026 check: 488.920ms
jquery.sparkline.js:1042 render: 491.113ms
jquery.sparkline.js:963 9
jquery.sparkline.js:1026 check: 483.986ms
jquery.sparkline.js:1042 render: 495.866ms
jquery.sparkline.js:963 10
jquery.sparkline.js:1026 check: 483.460ms
jquery.sparkline.js:1042 render: 484.395ms
jquery.sparkline.js:963 11
jquery.sparkline.js:1026 check: 478.421ms
jquery.sparkline.js:1042 render: 487.549ms
jquery.sparkline.js:963 12
jquery.sparkline.js:1026 check: 499.831ms
jquery.sparkline.js:1042 render: 481.652ms
jquery.sparkline.js:963 13
jquery.sparkline.js:1026 check: 478.360ms
jquery.sparkline.js:1042 render: 493.396ms
jquery.sparkline.js:963 14
jquery.sparkline.js:1026 check: 476.590ms
jquery.sparkline.js:1042 render: 486.453ms
jquery.sparkline.js:963 15
jquery.sparkline.js:1026 check: 487.244ms
jquery.sparkline.js:1042 render: 493.817ms
jquery.sparkline.js:963 16
jquery.sparkline.js:1026 check: 493.767ms
jquery.sparkline.js:1042 render: 480.530ms
jquery.sparkline.js:963 17
jquery.sparkline.js:1026 check: 478.076ms
jquery.sparkline.js:1042 render: 496.919ms
jquery.sparkline.js:963 18
jquery.sparkline.js:1026 check: 481.149ms
jquery.sparkline.js:1042 render: 489.816ms
jquery.sparkline.js:963 19
jquery.sparkline.js:1026 check: 490.570ms
jquery.sparkline.js:1042 render: 494.654ms
jquery.sparkline.js:963 20
jquery.sparkline.js:1026 check: 1504.319ms
jquery.sparkline.js:1042 render: 1477.507ms
jquery.sparkline.js:963 21
jquery.sparkline.js:1026 check: 1647.585ms
jquery.sparkline.js:1042 render: 1628.952ms
jquery.sparkline.js:963 22
jquery.sparkline.js:1026 check: 1607.548ms
jquery.sparkline.js:1042 render: 1623.313ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant