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

Verify timeoutID before calling clearTimeout #7901

Closed
ypconstante opened this issue Feb 21, 2018 · 2 comments
Closed

Verify timeoutID before calling clearTimeout #7901

ypconstante opened this issue Feb 21, 2018 · 2 comments
Assignees

Comments

@ypconstante
Copy link

@ypconstante ypconstante commented Feb 21, 2018

Actual behaviour

When destroying a chart, Highcharts calls clearTimeout a lot of times. For some reasons, browsers are kind of slow when calling clearTimeout with a null or undefined value, which is what happens a lot of times in this clearTimeout calls. In some tests I've made, the time for the execution of clearTimeout and removeChild were the same.

Live demo with steps to reproduce

clearTimeout performance demo: https://jsperf.com/null-check-cleartimeout-vs-cleartimeout-null/3

Product version

Highcharts 6.0.7

Affected browser(s)

Chrome 64

@pawelfus
Copy link
Contributor

@pawelfus pawelfus commented Feb 23, 2018

@ypconstante - it looks like your jsperf is broken, could you update the URL?

@ypconstante
Copy link
Author

@ypconstante ypconstante commented Feb 23, 2018

jsperf is returning error in every page right now.

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

Successfully merging a pull request may close this issue.

None yet
2 participants