Repository navigation
perf(ltx): compute the CRC-64 and the LZ4 blocks without BigInt - #53
Merged
Merged
Conversation
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
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.
The checksum and the compression of each page did 64-bit arithmetic with BigInt, one byte at a time. In a CPU profile of a thread replicating many databases which write 100 KB to 1 MB each,
Crc64.updateandcompressBlocktook 70 to 90% of the time, and the thread stayed at 100% of its event loop.Both now handle 64-bit values as 32-bit halves. The output is byte for byte the same: new tests compare it with the previous code, kept as a test helper, on random and database-like pages, and the Go fixtures still match.
BASELINE=1 pnpm bench:encode, the benchmark added inbench/bench-ltx-encode.ts: 2,048 pages of 4,096 bytes, best of 5 rounds, Node.js 26.13.1.