Skip to content

Add context-reuse compression benchmark - #75

Draft
kibertoad wants to merge 1 commit into
oleg-st:masterfrom
kibertoad:bench/context-reuse
Draft

kibertoad wants to merge 1 commit into
oleg-st:masterfrom
kibertoad:bench/context-reuse

Conversation

@kibertoad

Copy link
Copy Markdown
Contributor

Adds a CompressReuse category to ZstdSharp.Benchmark. It compresses dickens at level 1 and then at level 7 on the same context, for both native and ZstdSharp.

The existing Compress benchmark always compresses at one level on its context, so it doesn't catch state that leaks from one call into the next. The stale useRowMatchFinder fixed in #74 (generator side: oleg-st/ZstdSharp.Generator#1) is that kind of bug. It makes level 7 fall back to the hash chain match finder whenever a level-1 call ran on the same context first.

Results on a Ryzen 7 7700X, .NET 10 (net9.0 build rolled forward):

master with #74
CompressReuseNative 203 ms 215 ms
CompressReuseSharp 713 ms (3.55x) 193 ms (0.91x)

The Compress and Decompress categories are unchanged.

Compresses at level 1 and then level 7 on the same context. The existing
Compress benchmark always runs one level on a context, so it can't catch
state leaking between calls, such as the stale useRowMatchFinder fixed in oleg-st#74.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant