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

Stefan Miklosovic updated CASSANDRA-21677:
------------------------------------------
                        Authors: Stefan Miklosovic
    Test and Documentation Plan: ci
                         Status: Patch Available  (was: Open)

The patch is part of this branch (1), it's ci (2)

(1) [https://github.com/apache/cassandra/pull/5164]

(2) 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/6716/workflows/d64d1b4f-73e7-42bd-9c12-2e7e4bae5217]


> 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
>            Priority: Normal
>          Time Spent: 10m
>  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to