Skip to content

Add zstd dictionary compression strategy - #456

Draft
hendrikmuhs wants to merge 6 commits into
KeyviDev:masterfrom
hendrikmuhs:zstd-dict-compression
Draft

hendrikmuhs wants to merge 6 commits into
KeyviDev:masterfrom
hendrikmuhs:zstd-dict-compression

Conversation

@hendrikmuhs

Copy link
Copy Markdown
Contributor

Add ZstdDictCompressionStrategy that uses pre-trained zstd dictionaries for improved compression of small values. The dictionary is passed at construction time and used for both compression and decompression via ZSTD_CDict/ZSTD_DDict.

Add ZstdDictCompressionStrategy that uses pre-trained zstd dictionaries
for improved compression of small values. The dictionary is passed at
construction time and used for both compression and decompression via
ZSTD_CDict/ZSTD_DDict.

Co-Authored-By: Claude Code <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 38. Check the log or trigger a new build to see more.

Comment thread keyvi/include/keyvi/compression/compression_selector.h
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
hendrikmuhs and others added 2 commits September 21, 2026 08:50
Co-Authored-By: Claude Code <noreply@anthropic.com>
- Add override to destructor
- Add deleted move constructor/assignment operator
- Use explicit nullptr comparisons instead of implicit bool conversion
- Use explicit != 0u for ZSTD_isError checks
- Add braces around single-line if bodies
- Use operator[] instead of data()[0]
- Make result variable const
- Add NOLINTNEXTLINE for unavoidable pointer arithmetic
- Add missing direct includes for cstddef, cstdint, compression_algorithm.h

Co-Authored-By: Claude Code <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 13. Check the log or trigger a new build to see more.

Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/include/keyvi/compression/zstd_dict_compression_strategy.h Outdated
Comment thread keyvi/tests/keyvi/compression/zstd_dict_compression_strategy_test.cpp Outdated
Comment thread keyvi/tests/keyvi/compression/zstd_dict_compression_strategy_test.cpp Outdated
Comment thread keyvi/tests/keyvi/compression/zstd_dict_compression_strategy_test.cpp Outdated
hendrikmuhs and others added 3 commits September 21, 2026 09:17
- Use uppercase literal suffix 0U instead of 0u
- Add [[nodiscard]] to name() and GetFileVersionMin()
- Remove unused include from compression_selector.h
- Add samples.reserve(200) before loops in tests
- Make dict_size, plain_size, strategy const where possible

Co-Authored-By: Claude Code <noreply@anthropic.com>
- Replace ZSTD_DEFAULT_CLEVEL macro with constexpr kZstdDefaultCompressionLevel
- Use C++17 concatenated namespace keyvi::compression

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
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