Skip to content

Conversation

@simonbrunel
Copy link
Member

Some optimizations (speed and size) around the line controller and point element. Great performance benefit comes from removing the redundant hasOwnProperty calls in helpers.each() loops.

The Chart.helpers.each method uses Object.keys() to iterates on the object *own enumerable properties*, meaning that checking if object.hasOwnProperty() is useless.
Change some helpers.each() to `for` loops when iterating on a potentially large number of items and use more local variables when appropriate (making the minified build a bit smaller).
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 75.7% when pulling 93c28a4 on simonbrunel:optimizations into ca7434a on chartjs:master.

@etimberg
Copy link
Member

Looks good. +1 to merge

@etimberg etimberg merged commit d23b239 into chartjs:master May 18, 2016
@simonbrunel simonbrunel deleted the optimizations branch June 5, 2016 17:35
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

Successfully merging this pull request may close these issues.

3 participants