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

fix: improve performance of snapshot sorting #681

Closed
wants to merge 1 commit into from
Closed

Conversation

noahnu
Copy link
Collaborator

@noahnu noahnu commented Jan 26, 2023

Prior art: #680

Addresses: #657

return [cls.__maybe_int(part) for part in snapshot.name.split(".")]
if "." in snapshot.name:
index = snapshot.name.rfind(".") + 1
return f"{snapshot.name[:index-1]}.{snapshot.name[index:].zfill(4)}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The zfill is arbitrary but should ensure sorting of at least 1000 assertions within a single test case.

@codecov
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Merging #681 (b601ed6) into next (4ca0716) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             next     #681      +/-   ##
==========================================
+ Coverage   98.57%   98.63%   +0.06%     
==========================================
  Files          20       20              
  Lines        1402     1396       -6     
==========================================
- Hits         1382     1377       -5     
+ Misses         20       19       -1     

@noahnu
Copy link
Collaborator Author

noahnu commented Jan 26, 2023

This PR doesn't solve the perf issues. Will have to do some actual profiling.

@noahnu noahnu closed this Feb 2, 2023
@noahnu noahnu deleted the perf_sort_2 branch February 2, 2023 17:04
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