-
Notifications
You must be signed in to change notification settings - Fork 423
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
Add test_prefix_files
#5260
Add test_prefix_files
#5260
Conversation
1497cad
to
223e8a9
Compare
CodSpeed Performance ReportMerging #5260 will not alter performanceComparing Summary
|
4a9f3ff
to
e85fc20
Compare
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.
Just a minor note about function definition location
conda_build/utils.py
Outdated
def relpath(*path: str) -> str: | ||
# this is os.path.relpath, just hacked to be faster | ||
return join(*path).replace(prefix, "", 1).lstrip(os.path.sep) |
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.
Should we move the function out of prefix_files
to not define on every call?
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.
Updated the algorithm slightly and eliminated the need for the helper function entirely, see 89e2edc
It's even faster now! ⚡
---------------------------------------------------------------------------------- benchmark: 4 tests -----------------------------------------------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_slicing 38.0992 (1.0) 48.0364 (1.0) 41.1855 (1.0) 3.0405 (3.63) 39.9373 (1.0) 3.2863 (3.47) 8;3 24.2804 (1.0) 26 1
test_fast_relpath 41.9621 (1.10) 49.4438 (1.03) 44.7707 (1.09) 2.4972 (2.99) 45.0585 (1.13) 4.9830 (5.26) 10;0 22.3361 (0.92) 21 1
test_relpath 84.3830 (2.21) 87.2163 (1.82) 85.4201 (2.07) 0.8365 (1.0) 85.3213 (2.14) 0.9473 (1.0) 5;1 11.7068 (0.48) 12 1
test_pathlib 400.0558 (10.50) 418.3695 (8.71) 408.1218 (9.91) 6.7014 (8.01) 407.1493 (10.19) 7.5565 (7.98) 2;0 2.4502 (0.10) 5 1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Description
While working on #5255 found that
conda_build.utils.prefix_files
makes an unnecessary call toexpand_globs
. We only callexpand_globs
for symlink directories andexpand_globs
returns the path as is for symlinks.Checklist - did you ...
Add a file to thenews
directory (using the template) for the next release's release notes?Add / update outdated documentation?