perf(core): Implement getClass using cborlite - #3937
Draft
RafaelGranza wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## perf/cbor/encoder #3937 +/- ##
=====================================================
- Coverage 74.81% 74.79% -0.03%
=====================================================
Files 469 469
Lines 41433 41440 +7
=====================================================
- Hits 30997 30993 -4
- Misses 8313 8322 +9
- Partials 2123 2125 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RafaelGranza
force-pushed
the
perf/cbor/class
branch
from
August 15, 2026 05:22
bad0566 to
cd308d7
Compare
A class is the biggest value the node reads out of its own database, and the generic decoder walks it twice: once to check it is well formed, then again to fill the value. Both accessors and UnmarshalBinary go through cborlite now, so no step of the read touches the generic decoder unless it declines the shape. Worth 5.7x on a Sierra class, and half the memory, since the wrapper is aliased instead of copied.
RafaelGranza
force-pushed
the
perf/cbor/class
branch
from
August 15, 2026 05:25
cd308d7 to
c47dbca
Compare
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.
getClassRPC in a saturated node is ~1.6x faster.Considering only the decode time, decoding a large sierra is ~6x faster. deprecatedCairo is 2x faster.
Flame Graph (Main):
Flame Graph (This PR):
The
Handler.Classused to use ~41% of CPU, now uses only ~15%.