Skip to content

Add native fast reset compressors#44

Open
TyomaVader wants to merge 4 commits intoyawkat:mainfrom
TyomaVader:feat/fast-reset-compressor
Open

Add native fast reset compressors#44
TyomaVader wants to merge 4 commits intoyawkat:mainfrom
TyomaVader:feat/fast-reset-compressor

Conversation

@TyomaVader
Copy link
Copy Markdown

Introduces JNI-based fast reset compressors, significantly improving the efficiency of compressor reuse by leveraging the native fastReset API from the C library.

When executing consecutive compressions, state re-initialization on each call can be a performance bottleneck. Native LZ4_compress_fast_extState_fastReset and LZ4_compress_HC_extStateHC_fastReset methods solve this by clearing only the necessary parts of the existing external state.

Warning

Unfortunately, that introduces a pointer to native mutable memory, so these new classes are not thread-safe and require explicit release of native resources (via close()).

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