Commit fbcf630
committed
feat(acl): criterion benchmarks + nix bench-builder
Adds criterion benchmarks for both backends at v4 and v6 widths,
plus the nix / just plumbing to produce bench binaries from a
sandboxed build.
acl/benches/:
- reference_five_tuple.rs sweeps a deep miss (full per-rule scan)
and an early hit through the reference's O(rules * fields) linear
scan. Both widths.
- dpdk_five_tuple.rs is the rte_acl companion: trie walk cost (close
to flat in rule count), miss vs hit, single-shot vs SIMD batch.
v6 exercises the wide-field split (one 16-byte address -> four
4-byte sub-fields). Requires a live EAL.
- table_build.rs measures construction cost vs rule count: reference
(lower + Vec wrap) and DPDK (rte_acl_build, the update-latency
cost). Both widths. iter_batched so teardown is excluded.
acl/Cargo.toml gets the criterion dev-dep and three harness = false
[[bench]] entries. Workspace Cargo.toml gets the criterion = 0.5.1
shared dep entry.
default.nix adds a bench-builder derivation: cargo bench --no-run
under the profile-appropriate DPDK sysroot, then copies each
compiled benchmark into $out/bin (stripping cargo's -<hash>
suffix). Linked against the optimized DPDK when profile = release.
justfile adds a bench recipe that builds the benches package and
runs every binary under results/benches/bin/ in turn.
just fmt; cargo check --workspace --all-targets and
cargo clippy -p dataplane-acl --features dpdk -- -D warnings pass.
Signed-off-by: Daniel Noland <daniel@githedgehog.com>1 parent db13ea7 commit fbcf630
8 files changed
Lines changed: 716 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 10 | | |
17 | 11 | | |
18 | 12 | | |
| |||
25 | 19 | | |
26 | 20 | | |
27 | 21 | | |
28 | | - | |
29 | | - | |
30 | 22 | | |
31 | | - | |
32 | | - | |
| 23 | + | |
33 | 24 | | |
34 | | - | |
35 | | - | |
36 | 25 | | |
37 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments