navid/veins / master / xveins/BENCH.md

BENCH.md

← xveins · 3840 bytes · raw · download

Showing source. View rendered.

# veins C++ optimization benchmark

Generated 2026-11-28 03:22:02 UTC by `bench/optim_bench.py`.

### Environment

| Binary    | Version                        |
| :-------- | :----------------------------- |
| Baseline  | `veins v0.0.1 (veins-store 1)` |
| Optimized | `veins v0.0.1 (veins-store 1)` |

```
host:        Linux x86_64
cpu:         AMD Ryzen 5 5600 6-Core Processor
repeats:     5 (median reported)
inner runs:  3 per command per repeat
cpu pinning: no
temp dir:    /dev/shm
```

### Workload

- Base snapshot: 2.95 MiB, 42 files.
- 80 edit/commit revisions, 8 checkouts, 5 repeats, median reported.
- Each revision rewrites about 1% of a 120,000-line generated C file and three small module files.
- Commit total covers all revision commits in the run.
- Status and log are measured on the full history after the last commit.
- Checkout walks the newest revisions in descending order.

### Results

| Metric             |               Baseline |              Optimized |       Speedup |
| :----------------- | ---------------------: | ---------------------: | ------------: |
| Commit total [s]   | 1.2404 (1.2176-1.2505) | 1.0918 (1.0794-1.1877) |         1.14x |
| Status [ms]        |       49.6 (49.4-50.2) |       14.4 (14.0-15.1) |         3.44x |
| Log [ms]           |       50.6 (50.1-51.7) |       13.3 (13.3-14.1) |         3.79x |
| Log -l 5 [ms]      |       50.4 (49.9-51.6) |       13.2 (13.0-14.6) |         3.81x |
| Checkout total [s] | 0.3880 (0.3791-0.4098) | 0.1667 (0.1650-0.1754) |         2.33x |
| Checkout mean [ms] |       48.5 (47.4-51.2) |       20.8 (20.6-21.9) |         2.33x |
| Store size [MiB]   |    43.01 (43.01-43.31) |    42.92 (42.92-42.92) | 1.00x smaller |

Each cell is the median with the observed min-max range in parentheses.
A speedup above 1 means the optimized binary was faster.

### Repeats

| Repeat | Baseline status [ms] | Optimized status [ms] | Baseline log [ms] | Optimized log [ms] | Baseline checkout [ms] | Optimized checkout [ms] |
| :----- | -------------------: | --------------------: | ----------------: | -----------------: | ---------------------: | ----------------------: |
| 1      |                 50.2 |                  15.1 |              51.7 |               14.1 |                   51.2 |                    21.9 |
| 2      |                 49.6 |                  14.0 |              50.5 |               13.6 |                   49.2 |                    20.7 |
| 3      |                 49.4 |                  14.2 |              51.0 |               13.3 |                   48.5 |                    20.9 |
| 4      |                 50.1 |                  14.5 |              50.6 |               13.3 |                   47.4 |                    20.6 |
| 5      |                 49.6 |                  14.4 |              50.1 |               13.3 |                   48.2 |                    20.8 |

### Notes

- The optimized build reads only the requested record from a pack instead of decoding the whole pack for every lookup.
- Status and log memoize conflict-tree results and avoid flattening trees that are already equal.
- Checkout reuses a single store, preloads indexes only, and skips rewriting files whose target object did not change.
- Commit keeps the same object format, compression level, and operation-log sequence. Its gains come from fewer pack decodes and from writing the describe and new operations in one chained pack.
- The baseline binary is the C++ build from before these changes. Rebuild each binary from its own source snapshot before reproducing.
- This is a single-machine run. Treat differences below roughly 5% as noise.

### Reproduce

```sh
cmake --build build -j
python3 bench/optim_bench.py \
  --baseline /path/to/pre-optimization/vn \
  --optimized build/vn \
  --markdown-out BENCH.md
```