-
Notifications
You must be signed in to change notification settings - Fork 12k
Add ticks.sampleSize option #6508
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
Conversation
a635144 to
fa09223
Compare
kurkle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I don't like the implementation. Its getting really hard to follow what is contained in ticks or me.ticks or me._ticks at different stages and why.
Could the same performance gain be achieved by just changing computeLabelSizes to use sampleSize?
43ef566 to
7b66d0c
Compare
Unfortunately, it's a little more complicated than that. The main thing we want to do to achieve the performance gains is have
I agree that it's quite hard to follow |
7deb0c6 to
c80f168
Compare
c80f168 to
a8f9603
Compare
This allows users to set a
sampleSizeoption which is a major performance improvement when there's a large number of ticks / labelsThe charts render nearly twice as fast with this option. Here's timing information for
samples/scales/time/financial.htmlchanged to render 8,000 datapoints:Without this PR: 520ms
With
sampleSize: 100: 272msPlunker: https://plnkr.co/edit/Bj6unMv5JSL69nfUZ3zx?p=preview