Skip to content

perf: skip CRC check on hot-path block reads - #70

Open
gdeest wants to merge 7 commits into
fix/gsa-functional-issuesfrom
perf/no-crc-on-hotpath
Open

gdeest wants to merge 7 commits into
fix/gsa-functional-issuesfrom
perf/no-crc-on-hotpath

Conversation

@gdeest

@gdeest gdeest commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

This replaces extractBlockComponent with a extractBlockComponentNoCRC, a drop-in replacement
that skips CRC check. This roughly doubles the throughput of the GSA.

`extractBlockComponentNoCRC` is a drop-in replacement for upstream's
`extractBlockComponent` for the `BlockComponent` shapes the GSA actually
serves (`GetHash`, `GetSlot`, `GetIsEBB`, `GetBlockSize`, `GetHeaderSize`,
`GetRawBlock`, `GetRawHeader`, `GetNestedCtxt`, plus `GetPure` / `GetApply`
composition). Chunks served by the GSA are already CRC-verified at download
time in `RemoteStorage`, so re-checking on every per-block read in the
serving path is pure overhead. Profiling showed CRC32 prominent in the hot
path; the removal contributed to a synthetic-bench jump from ~7 MB/s to
~13 MB/s @ p=8.

Removing the dependency on `extractBlockComponent` also lets us drop the
`DecodeDisk blk (ByteString -> blk)` and `DecodeDiskDep (NestedCtxt Header) blk`
constraints from a number of signatures in both files.

@vreuter vreuter 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.

Essentially ready to merge, just one question here, and I opened #75 with a few suggestions

ChunkNo ->
m (Iterator m blk b)
mkRawBlockIterator hasFS chunkInfo codecConfig checkIntegrity component applyFrom applyTo chunk = do
mkRawBlockIterator hasFS chunkInfo _codecConfig _checkIntegrity component applyFrom applyTo chunk = do

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.

Why keep these parameters?

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.

2 participants