https://github.com/domenkozar/snix-hello-bench
https://github.com/domenkozar/snix-hello-bench
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/domenkozar/snix-hello-bench
- Owner: domenkozar
- Created: 2025-07-03T17:20:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T03:04:00.000Z (10 months ago)
- Last Synced: 2026-01-30T23:01:04.009Z (4 months ago)
- Language: Shell
- Size: 7.46 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snix vs Nix Benchmark
This repository contains benchmarks comparing [snix](https://git.snix.dev/snix/snix.git) (a Nix interpreter written in Rust) with the standard Nix implementation.
## Benchmark Task
Evaluating the derivation path for the `hello` package from nixpkgs:
- Snix: `(import {}).hello.drvPath`
- Nix: `(import {}).hello`
## Results
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:|
| `snix` | 1.003 ± 0.006 | 0.995 | 1.011 | 2.51 ± 0.04 |
| `nix-instantiate` | 0.400 ± 0.006 | 0.386 | 0.409 | 1.00 |
## Performance Analysis
The flamegraph for snix is available at [snix-flamegraph.svg](snix-flamegraph.svg), which shows where time is spent during evaluation.
## Running the Benchmark
```bash
# Enter the development environment
devenv shell
# Run the benchmark
benchmark
```
The benchmark script will:
1. Clone/update nixpkgs and snix repositories
2. Build snix in release mode
3. Run hyperfine to benchmark both implementations
4. Generate a flamegraph for snix
5. Update this README with the latest results
## Environment
- Rust: via devenv
- Nix: system installation
- Tools: hyperfine, flamegraph, perf