Skip to content

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

C:\>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

@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

@CarterLi
Copy link
Author

CarterLi commented May 3, 2025

Addressed @ariasuni's feedback and replaced Lazy for LazyLock.

@CarterLi CarterLi requested a review from ariasuni May 6, 2025 08:35
@gierens gierens self-requested a review May 20, 2025 15:07
gierens
gierens previously approved these changes May 20, 2025
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.

Since performance seems to be fine, LGTM! Thanks!

@CarterLi
Copy link
Author

Conflicts resolved. Any chance to get reviewed? @cafkafk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants