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

Two performance improvements #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aardvarkk
Copy link

Please see individual commit messages for details

  • Also includes some fixes to trailing whitespace, and no newline at EOF

Ian Clarkson added 2 commits September 18, 2018 14:56
- If the object being converted is already a DateTime, we can pass it directly to the RiCal DateTime constructor as-is, since that constructor already has support to skip stringifying/text parsing if a DateTime object is passed
- Checking equality via the `==` method involved a significant amount of computation
- I found that the majority of the time equality was being checked, parent and timezone_finder were actually the exact same object instance
- By checking for `equal?` first, we do a much simpler/faster (which is also more strict) first, allowing us to shortcut the lengthier equality comparison if the objects are actually the same instance
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.

1 participant