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 optimization isBefore/isAfter/isSame #1885

Closed
wants to merge 2 commits into from
Closed

Performance optimization isBefore/isAfter/isSame #1885

wants to merge 2 commits into from

Conversation

hupfis
Copy link
Contributor

@hupfis hupfis commented Aug 26, 2014

  • optimized performance of isBefore/isAfter/isSame by using valueOf and
    not momentizing/cloning already existing moment objects
  • 90% performance improvement when using without specific unit and the
    input is already a moment object

reviewed by PatrickBic

 - optimized performance of isBefore/isAfter/isSame by using valueOf and
   not momentizing/cloning already existing moment objects
 - 90% performance improvement when using without specific unit and the
     input is already a moment object

reviewed by PatrickBic
@ichernev
Copy link
Contributor

OK, I approve the idea of the optimization.

Can you please

  • rebase your patch on top of develop
  • use a variable for input / moment(input) to reduce the cases in each function.
  • use + in front of an expression in place of valueOf() (code style in the rest of the code)

- optimized performance of isBefore/isAfter/isSame by using valueOf and not momentizing/cloning already existing moment objects
- 90% performance improvement when using without specific unit and the input is already a moment object

reviewed by PatrickBic/tscheinecker
@hupfis
Copy link
Contributor Author

hupfis commented Aug 29, 2014

New pull request at #1892

@ichernev ichernev closed this Oct 9, 2014
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.

None yet

2 participants