Nullus157 / Nullus157/async-compression

Reuse zstd context for better perf

Open
#248 2 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
666
Forks
118
Avg merge
17h 18m
Merged PRs (30d)
9

Description

I noticed a new PR on zstd https://github.com/gyscos/zstd-rs/pull/247 that optimizes `zstd::stream::Encoder` by reusing zstd context:

> From profiling, I have found that creating a zstd::stream::Encoder and using it to encode a small amount of bytes (less than 100) takes over 200 microseconds per encode on my machine. The vast majority of this time is related to the creation of new zstd contexts, so this PR adds a simple method on Encoder and Decoder that allows one to supply an external context from zstd_safe instead. With these changes, performance is improved - the previously-mentioned benchmark takes less than 2 microseconds per encode.

from @DouglasDwyer

Seems like a good idea to support this once it is merged.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.