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

Implement simple caching for -fstype #419

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

nerdroychan
Copy link
Contributor

Fix #418.

Before:

Benchmark 1: find ~/Workspace -fstype xfs
  Time (mean ± σ):     195.8 ms ±   3.2 ms    [User: 34.7 ms, System: 160.7 ms]
  Range (min … max):   192.4 ms … 202.4 ms    14 runs

Benchmark 2: target/release/find ~/Workspace -fstype xfs
  Time (mean ± σ):     12.494 s ±  0.098 s    [User: 2.645 s, System: 8.936 s]
  Range (min … max):   12.318 s … 12.670 s    10 runs

Summary
  find ~/Workspace -fstype xfs ran
   63.80 ± 1.16 times faster than target/release/find ~/Workspace -fstype xfs

After:

Benchmark 1: find ~/Workspace -fstype xfs
  Time (mean ± σ):     190.7 ms ±   3.4 ms    [User: 30.6 ms, System: 159.8 ms]
  Range (min … max):   186.9 ms … 198.0 ms    15 runs

Benchmark 2: target/release/find ~/Workspace -fstype xfs
  Time (mean ± σ):     284.1 ms ±   3.2 ms    [User: 67.8 ms, System: 215.7 ms]
  Range (min … max):   278.7 ms … 289.0 ms    10 runs

Summary
  find ~/Workspace -fstype xfs ran
    1.49 ± 0.03 times faster than target/release/find ~/Workspace -fstype xfs

Not exactly as fast, but significantly faster than no caching.

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 65.84%. Comparing base (7f4423e) to head (4ae5e27).

Files Patch % Lines
src/find/matchers/fs.rs 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   65.51%   65.84%   +0.32%     
==========================================
  Files          34       34              
  Lines        3953     3970      +17     
  Branches      906      907       +1     
==========================================
+ Hits         2590     2614      +24     
  Misses        998      998              
+ Partials      365      358       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sylvestre sylvestre requested a review from hanbings July 12, 2024 06:46
@hanbings hanbings merged commit 9f44977 into uutils:main Jul 12, 2024
19 checks passed
@hanbings
Copy link
Collaborator

hanbings commented Jul 12, 2024

Merged. great optimization, thanks!

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.

Cache the mount table for -fstype
2 participants