Skip to content

Conversation

@benmccann
Copy link
Contributor

@benmccann benmccann commented Jan 15, 2019

These were mostly no-ops now that we have timestamps

new Date().getTime() is more than twice as fast as +new Date() and Date.now() faster still. https://jsperf.com/new-date-timing

It also appears to be faster not to use +moment as well. https://jsperf.com/moment-getvalue

Related to #5960

etimberg
etimberg previously approved these changes Jan 15, 2019
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 small comments

Copy link
Member

@simonbrunel simonbrunel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree with the changes in adapter.moment.js (and Date.now()), I don't think there is any good reason to remove the + to cast to number in scale.time.js.

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