coolbutuseless / zstdlite

Fast, configurable in-memory compression of R objects with zstd
Other
28 stars 0 forks source link

Support for separate cctx initialisation #9

Closed coolbutuseless closed 8 months ago

coolbutuseless commented 8 months ago

Docs seem to imply that cctx initialisation can soak up time, and re-using cctx is a valid approach.

Figure out a separate cctx initialization step, then optionally pass in to zstd_compress() and zstd_serialize()

Benchmark it.

coolbutuseless commented 8 months ago

Added in: https://github.com/coolbutuseless/zstdlite/commit/b85cc8c4ea12b68f686351f0ef2ef0a7d74611c6

For compression of tiny artefacts, 5-15% speed increase, but not anything really noteworthy.

Future work: Separate cctx initialisation paves the way for dictionaries.