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(windows): report executable files #1318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CarterLi
Copy link

@CarterLi CarterLi commented Jan 5, 2025

$PATHEXT is an Environment Variable that stores a list of the file extensions for operation system to execute. A file is considered executable if its extension matches $PATHEXT

@gierens
Copy link
Member

gierens commented Jan 20, 2025

FreeBSD tests are failing due to clippy issues that this PR among other things fixes: #1327

@gierens
Copy link
Member

gierens commented Jan 20, 2025

I rebased main and thus also added a fix for the FreeBSD pipeline ... CI should be green now.

Copy link
Member

@gierens gierens left a comment

Choose a reason for hiding this comment

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

This seems like a definite improvement over the current behavior, thanks!

OnceLock shouldn't incur a performance penalty if I remember correctly, right? ... Have you validated that? I don't have Windows, so I can't test it. On Linux I would've done something like this:

cargo build --release && hyperfine -w 500 -r 500  '{cmd} -l /usr/bin' --parameter-list cmd ./target/release/eza,eza --time-unit microsecond -N

@CarterLi
Copy link
Author

CarterLi commented Feb 14, 2025

I replaced OnceLock for Lazy, which can be further replaced for LazyLock as stated here, because the official document seems prefer LazyLock in simple cases

As for performance, I don't see much difference. As Windows I/O performance is bad comparing to *nix ( with antivirus running the performance is even MUCH worse ), I/O is always the bottleneck.

c:\Windows\System32🔒 via 🦀 v1.84.1 took 3s
❯ hyperfine.exe -w 20 -r 80 C:\msys64\home\zhang\eza\eza.old.exe C:\msys64\home\zhang\eza\eza.lazy.exe
Benchmark 1: C:\msys64\home\zhang\eza\eza.old.exe
  Time (mean ± σ):     237.0 ms ±  14.0 ms    [User: 38.5 ms, System: 199.6 ms]
  Range (min … max):   222.0 ms … 319.0 ms    80 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark 2: C:\msys64\home\zhang\eza\eza.lazy.exe
  Time (mean ± σ):     232.4 ms ±  12.2 ms    [User: 36.0 ms, System: 195.5 ms]
  Range (min … max):   219.6 ms … 311.9 ms    80 runs

  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  C:\msys64\home\zhang\eza\eza.lazy.exe ran
    1.02 ± 0.08 times faster than C:\msys64\home\zhang\eza\eza.old.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

2 participants