perf: finish H1 streaming JSONL output#275
Closed
omerbenamram wants to merge 12 commits intoperf/streaming-output-noallocfrom
Closed
perf: finish H1 streaming JSONL output#275omerbenamram wants to merge 12 commits intoperf/streaming-output-noallocfrom
omerbenamram wants to merge 12 commits intoperf/streaming-output-noallocfrom
Conversation
Reuse a single JsonStreamOutput buffer in evtx_dump (-t 1) and reduce key/value churn in JsonStreamOutput.
Record omer-pc hyperfine numbers and macOS samply leaf deltas for the H1 JSON streaming scratch reuse experiment.
Replace per-object HashSet duplicate key tracking with a small, Zig-style name/count table. This reduces hash/memcmp overhead on the JSON streaming hot path.
Avoid extra Arc clones in the Zig-style key table and compare wide pointers by address.
Record omer-pc hyperfine results and macOS samply leaf deltas for the fixed-table duplicate-key tracker.
Use pointer-address comparisons directly over the Arc list to keep the Zig-style key table simpler and more idiomatic.
Update omer-pc hyperfine medians to match the latest artifact.
Replace Arc<str> key interning with a safe KeyId arena (Vec<Box<str>>), and resolve keys by id. This keeps duplicate-key tracking hash-free while avoiding refcount overhead.
Swap the custom KeyId arena interner for lasso::Rodeo to speed up get-or-intern and key resolution.
Enable lasso's ahasher + inline-more features to reduce SipHash overhead in get_or_intern on the streaming JSON path.
Record new omer-pc hyperfine medians and macOS samply leaf deltas for lasso key interning and the ahasher improvement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JsonStreamOutput<Vec<u8>>across records forevtx_dump -o jsonl -t 1to reduce per-record allocation churn.lasso::Rodeo(withahasher+inline-more) to reduce string interning overhead.PERF.mdwith benchmark + samply deltas and add/copy perf artifacts.Perf
samples/security_big_sample.evtx),-t 1 -o jsonl, quiet-gated onomer-pctarget/perf/h1-lasso-ahash-before-vs-after.hyperfine.jsonSamply (macOS, 200 iterations)
_platform_memmove: 7.38% → 4.80% leaf_rjem_malloc: 3.15% → 1.23% leafalloc::raw_vec::RawVecInner<A>::finish_grow: 1.62% → 0.96% leafhashbrown::map::HashMap<K,V,S,A>::get_inner: 3.20% → 0.00% leaf (after1 → after2)<core::hash::sip::Hasher<S> as core::hash::Hasher>::write: 7.32% → 2.01% leaf (after3 → after4, enablingahasher)target/perf/samply/h1_before.profile.json.gz+target/perf/samply/h1_before.profile.json.syms.jsontarget/perf/samply/h1_after.profile.json.gz+target/perf/samply/h1_after.profile.json.syms.jsontarget/perf/samply/h1_after2.profile.json.gz+target/perf/samply/h1_after2.profile.json.syms.jsontarget/perf/samply/h1_after4.profile.json.gz+target/perf/samply/h1_after4.profile.json.syms.jsonTest plan
cargo test --features fast-alloc --lockedNote
Completes H1 by removing hot-path allocations in streaming JSONL and tightening duplicate-key handling.
JsonStreamOutput<Vec<u8>>forevtx_dump -t 1 -o jsonlviadump_json_streaming_single_thread(avoids per-recordVec/Stringchurn)JsonStreamOutputinternals:UniqueKeyTable(no per-key hashing on hot path)lasso::Rodeo(ahasher,inline-more)BufferedValuesand recycled object frames; newbuffer()/clear_buffer()/reserve_buffer()EvtxRecord::write_json_streamfor writing into an existing builderlassodependency; lockfile updates; regression tests (including reuse-after-error state reset)Written by Cursor Bugbot for commit 9265a68. This will update automatically on new commits. Configure here.