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

[performance] faster major tick calculation #6307

Merged
merged 3 commits into from
Jun 19, 2019

Conversation

benmccann
Copy link
Contributor

@benmccann benmccann commented May 29, 2019

This is a major speedup when ticks.source is data or labels. The speed up is because it avoids calling startOf on every tick, which is expensive since it creates a moment object and does a non-trivial calculation. It's also necessary to implement #6274 efficiently. I'll rebase that PR and reopen a re-worked version of it after this change and #6304 are merged

Before:
before

After:
after

src/scales/scale.time.js Outdated Show resolved Hide resolved
src/scales/scale.time.js Outdated Show resolved Hide resolved
src/scales/scale.time.js Outdated Show resolved Hide resolved
@etimberg etimberg merged commit b31980e into chartjs:master Jun 19, 2019
@nagix nagix added this to the Version 2.9 milestone Jun 19, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
* [performance] faster major tick calculation

* Address review comments

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

Successfully merging this pull request may close these issues.

4 participants