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

Add test_prefix_files #5260

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Add test_prefix_files #5260

merged 3 commits into from
Apr 18, 2024

Conversation

kenodegard
Copy link
Contributor

Description

While working on #5255 found that conda_build.utils.prefix_files makes an unnecessary call to expand_globs. We only call expand_globs for symlink directories and expand_globs returns the path as is for symlinks.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Mar 27, 2024
Copy link

codspeed-hq bot commented Mar 27, 2024

CodSpeed Performance Report

Merging #5260 will not alter performance

Comparing kenodegard:test_prefix_files (89e2edc) with main (9267dae)

Summary

✅ 3 untouched benchmarks

@kenodegard kenodegard marked this pull request as ready for review March 28, 2024 04:36
@kenodegard kenodegard requested a review from a team as a code owner March 28, 2024 04:36
jezdez
jezdez previously approved these changes Apr 3, 2024
Copy link
Member

@jezdez jezdez left a 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

Comment on lines 1789 to 1791
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)
Copy link
Member

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?

Copy link
Contributor Author

@kenodegard kenodegard Apr 3, 2024

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
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@jezdez jezdez merged commit e35daf4 into conda:main Apr 18, 2024
28 checks passed
@kenodegard kenodegard deleted the test_prefix_files branch April 18, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants