An open API service indexing awesome lists of open source software.

https://github.com/domenkozar/snix-hello-bench


https://github.com/domenkozar/snix-hello-bench

Last synced: 13 days ago
JSON representation

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