You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yifan Cai (Jira)" <ji...@apache.org> on 2026/09/18 17:04:00 UTC

[jira] [Assigned] (CASSANDRA-21677) Pool Native Zstd Contexts in Plain ZstdCompressor

     [ https://issues.apache.org/jira/browse/CASSANDRA-21677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yifan Cai reassigned CASSANDRA-21677:
-------------------------------------

    Assignee: Stefan Miklosovic  (was: Yifan Cai)

> Pool Native Zstd Contexts in Plain ZstdCompressor
> -------------------------------------------------
>
>                 Key: CASSANDRA-21677
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21677
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Feature/Compression
>            Reporter: Yifan Cai
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>         Attachments: dicts.png, image2.png
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> ZstdCompressorBase.compress()/uncompress() call Zstd's static one-shot helpers (Zstd.compress, Zstd.decompress, Zstd.decompressByteArray), each of which allocates a native ZSTD_CCtx/ZSTD_DCtx and frees it before returning, once per chunk. 
> According to CASSANDRA-21672, profiling of the dictionary-compression path found roughly 6.5% of node CPU in ZSTD_createCCtx alone at small chunk sizes, and the same per-chunk allocation cost applies to plain, non-dictionary Zstd compression, which is unaffected by that work. ZstdCompressor should pool a reusable ZstdCompressCtx/ZstdDecompressCtx per compressor instance, instead of allocating and freeing a native context on every chunk.
> That said, the plain ZstdCompressor is likely less impacted by the per chunk allocation, as it typically requires larger chunk size to achieve a good compression ratio. The effect of per chunk allocation is more significant for small chunks such as 4KiB.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org