-
Notifications
You must be signed in to change notification settings - Fork 110
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
Improve efficiency of the default date/time parsing methods (16% speed-up) #1298
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Performance comparison of head (4224b3a) vs base (276f731)
|
budnix
approved these changes
Aug 17, 2023
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.
Looks good 👌
sequba
changed the title
Improve efficiency of the default date/time parsing methods
Improve efficiency of the default date/time parsing methods (16% speed-up)
Aug 30, 2023
14 tasks
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1298 +/- ##
===========================================
+ Coverage 97.20% 97.23% +0.03%
===========================================
Files 167 167
Lines 14299 14304 +5
Branches 3064 3065 +1
===========================================
+ Hits 13899 13909 +10
Misses 395 395
+ Partials 5 0 -5
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test case
A spreadsheet with 500k rows and 10 columns filled with string data. Total of 5M data cells, no formulas, no date/time values.
Script:
Ideas for improvement
getTopSortedWithSccSubgraphFrom
(total time 42.7%), which is the iterative implementation of the Tarjan algorithm that performs the topological sorting of the dependency graph and finds cycles (SCCs) in the graph. In this test case, the dependency graph is trivial; it contains only isolated nodes without any edges. It seems that it can be done more efficiently.parseDateTimeFromConfigFormats
(total time 21.2%), which tries to parse all string data as date/time values. This test case contains no date/time values, so there might be some way of saving time by determining it quickly and avoiding running the heavy parsing operations.This PR focuses on optimizing date/time parsing functions
Results
Total time:
Before: 32264ms
After: 26391ms
Function
parseDateTimeFromConfigFormats
:Before: 21.2%
After: 6.3%
Profiler:
Before:
After:
Profiler: Chrome Dev Tools
This result corresponds to ~16% speed-up of HyperFormula for this use-case.
How did you test your changes?
Types of changes
Related issues:
Checklist: