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

perf(build): switch build optimization from ReleaseSafe to ReleaseFast #67

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

hendriknielaender
Copy link
Owner

This pull request changes the build optimization mode for the Zig Version Manager (zvm) from ReleaseSafe to ReleaseFast. The ReleaseFast mode prioritizes performance by removing safety checks, making it more suitable for production use where maximum efficiency is desired.

Benchmark Results

Benchmarks were conducted using hyperfine to compare the performance of ReleaseSafe and ReleaseFast builds. Here are the results for various commands:

Command ReleaseFast Time (mean ± σ) ReleaseSafe Time (mean ± σ) Speed Improvement
zvm --help 4.4 ms ± 2.4 ms 4.6 ms ± 1.1 ms 1.06× faster
zvm -v 4.6 ms ± 1.1 ms 5.1 ms ± 1.0 ms 1.11× faster
zvm ls 657.9 ms ± 23.9 ms 731.6 ms ± 33.9 ms 1.11× faster
zvm ls --system 4.6 ms ± 1.0 ms 6.3 ms ± 1.1 ms 1.35× faster

Observations

  • Across all tested commands, the ReleaseFast build consistently outperformed the ReleaseSafe build.

Warnings

  • Commands with execution times under 5 ms may have inaccuracies due to shell startup time calibration limitations. These results should still reflect relative performance differences.

Justification for Change

  • Faster command execution aligns with user expectations for a CLI tool.
  • The lack of safety checks in ReleaseFast is acceptable.

@hendriknielaender hendriknielaender added the enhancement New feature or request label Dec 10, 2024
@hendriknielaender hendriknielaender self-assigned this Dec 10, 2024
@hendriknielaender hendriknielaender merged commit f5846a4 into main Dec 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant