Commit Graph

1 Commits (d44b6d412f1f183ef80fbbf2c6274c4826c2aebd)

Author SHA1 Message Date
Dom Dwyer 7c28a30d1b
test(ingester2): WAL replay benchmark
This adds a simple WAL replay benchmark to ingester2 that executes a
replay of a single line of LP.

Unfortunately each file in the benches directory is compiled as it's own
binary/crate, and as such is restricted to importing only "pub" types.
This sucks, as it requires you to either benchmark at a high level
(macro, not microbenchmarks - i.e. benchmarking the ingester startup,
not just the WAL replay) or you are forced to mark the reliant types &
functions as "pub", as well as all the other types/traits they reference
in their signatures. Because the performance sensitive code is usually
towards the lower end of the call stack, this can quickly lead to an
explosion of "pub" types causing a large amount of internal code to be
exported.

Instead this commit uses a middle-ground; benchmarked types & fns are
conditionally marked as "pub" iff the "benches" feature is enabled. This
prevents them from being visible by default, but allows the benchmark
function to call them.

The benchmark itself is also restricted to only run when this feature is
enabled.
2022-12-12 15:02:36 +01:00