perf(cpp): skip LZ4 frame checksums (XXH32) for a measurable throughp… - #1742
Draft
facontidavide wants to merge 1 commit into
Draft
perf(cpp): skip LZ4 frame checksums (XXH32) for a measurable throughp…#1742facontidavide wants to merge 1 commit into
facontidavide wants to merge 1 commit into
Conversation
…ut gain Profiling a point-cloud-heavy MCAP showed LZ4_XXH32_update consuming more CPU than the decompression itself (~12% vs ~9% of total application CPU on a GUI thread). Skipping the frame-level block and content checksum via LZ4F_decompressOptions_t.skipChecksums eliminates that cost — roughly a 41% reduction in total LZ4 decode CPU. Structural corruption is still caught by the size/consumption checks already present in decompressAll(): wrong output size (dstSize != uncompressedSize), partial consumption (srcSize != compressedSize), and LZ4F_isError on the return code. The XXH32 integrity hash is therefore redundant for callers that trust the source (local files, verified network transports). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
facontidavide
requested review from
gasmith,
james-rms and
jtbandes
as code owners
June 22, 2026 11:43
facontidavide
marked this pull request as draft
June 22, 2026 11:47
james-rms
reviewed
Jun 22, 2026
james-rms
left a comment
Collaborator
There was a problem hiding this comment.
I think this makes sense to control via an option on the MCAP library, but might be unexpected as a default behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ut gain
Profiling a point-cloud-heavy MCAP showed LZ4_XXH32_update consuming more CPU than the decompression itself (~12% vs ~9% of total application CPU on a GUI thread). Skipping the frame-level block and content checksum via LZ4F_decompressOptions_t.skipChecksums eliminates that cost — roughly a 41% reduction in total LZ4 decode CPU.
Structural corruption is still caught by the size/consumption checks already present in decompressAll(): wrong output size (dstSize != uncompressedSize), partial consumption (srcSize != compressedSize), and LZ4F_isError on the return code. The XXH32 integrity hash is therefore redundant for callers that trust the source (local files, verified network transports).
Changelog
Docs
Description