reubeno / brush

bash/POSIX-compatible shell implemented in Rust
MIT License
26 stars 4 forks source link

refactor: replace `lazy_static` with `std::sync::LazyLock` #198

Open 39555 opened 1 month ago

39555 commented 1 month ago

The functionality of lazy_static now in the core since 1.80 https://github.com/rust-lang/rust/pull/121377

github-actions[bot] commented 1 month ago

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.33 μs 3.33 μs -0.00 μs ⚪ Unchanged
instantiate_shell 60.71 μs 59.29 μs -1.42 μs 🟢 -2.34%
instantiate_shell_with_init_scripts 29238.12 μs 28906.44 μs -331.68 μs 🟢 -1.13%
parse_bash_completion 2737.26 μs 2696.84 μs -40.43 μs 🟢 -1.48%
parse_sample_script 4.00 μs 3.96 μs -0.04 μs ⚪ Unchanged
run_echo_builtin_command 92.70 μs 89.44 μs -3.26 μs 🟢 -3.52%
run_one_builtin_command 108.71 μs 105.78 μs -2.93 μs 🟢 -2.69%
run_one_external_command 1958.90 μs 1906.28 μs -52.62 μs 🟢 -2.69%
run_one_external_command_directly 1010.91 μs 1011.85 μs 0.93 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/declare.rs 🟢 81.64% 🟢 81.99% 🟢 0.35%
brush-core/src/keywords.rs 🟢 96.88% 🟢 94.12% 🔴 -2.76%
brush-core/src/namedoptions.rs 🟠 54.33% 🟢 99.72% 🟢 45.39%
brush-core/src/shell.rs 🟢 81.68% 🟢 81.56% 🔴 -0.12%
brush-core/src/sys/unix/signal.rs 🟠 72.13% 🟢 75.41% 🟢 3.28%
brush-shell/src/main.rs 🟢 90.26% 🟢 90.32% 🟢 0.06%
Overall Coverage 🟢 75.12% 🟢 76.74% 🟢 1.62%

Minimum allowed coverage is 70%, this run produced 76.74%

reubeno commented 1 month ago

Nice!

Our current MSRV is 1.75, which was initially released about 10 months ago, and this would force us to move that forward. What would you see as the benefits of doing so now vs. later?

More broadly, we need to establish a general procedure for when we upgrade the MSRV. I'll need to do some research to see what other projects do, but am very open to input here.

39555 commented 1 month ago

We can do it later. There are no huge benefits