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

feat(perf): improve date sorting speed #259

Merged
merged 2 commits into from Feb 8, 2021

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Feb 7, 2021

Here's a quick perf date sorting test before & after code change with 50k rows and 8 columns
note: the date are all in ISO format (yyyy-mm-dd), it might be even bigger differences with non-ISO format

BEFORE

1st pass

sorting ASC: 2255.841064453125 ms
sorting DESC: 676.7099609375 ms
sorting ASC: 644.962646484375 ms
sorting DESC: 671.908935546875 ms

2nd pass

sorting ASC: 1981.27978515625 ms
sorting DESC: 692.999755859375 ms
sorting ASC: 673.643798828125 ms
sorting DESC: 670.118896484375 ms

AFTER

1st pass

sorting ASC: 1059.22802734375 ms
sorting DESC: 126.10400390625 ms
sorting ASC: 336.77685546875 ms
sorting DESC: 143.007080078125 ms

2nd pass

sorting ASC: 903.991943359375 ms
sorting DESC: 143.51708984375 ms
sorting ASC: 374.537109375 ms
sorting DESC: 117.73583984375 ms

@codecov
Copy link

codecov bot commented Feb 7, 2021

Codecov Report

Merging #259 (0926d40) into master (16c4984) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #259   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          208       208           
  Lines        12010     12010           
  Branches      4128      4128           
=========================================
  Hits         12010     12010           
Impacted Files Coverage Δ
packages/common/src/sortComparers/dateUtilities.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16c4984...0926d40. Read the comment docs.

@ghiscoding ghiscoding merged commit a52f4fc into master Feb 8, 2021
@ghiscoding ghiscoding deleted the feat/date-sorting-improvement branch February 8, 2021 13:30
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

1 participant