Repository navigation
Conversation
This branch was previously deployed
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.
A tracer reading
log.op.toString()once used to initialize all 256 JavaScript strings for that inspector, including the formatted names of undefined opcodes. Fill a slot only when the tracer asks for that opcode, and reuse the immutable string across inspectors on the same thread. The log wrappers remain per transaction.On a transaction executing a single STOP, the first lookup on a fresh inspector avoided 359 allocator requests and 26,140 requested bytes on an already-used worker. On the worker's very first transaction it avoided 357 requests and 24,020 bytes, including the new table and its first entry. The benefit is concentrated in tracing the first transaction of a fresh inspector. Long-running inspectors already reused their table.
The table occupies 2 KiB on the measured 64-bit host and is created only on threads that use opcode names. The change also removes the inspector's per-instance cache handle.
Measured release execution through JSON result collection against
0b079aa, with fresh-inspector construction outside the first-lookup measurement. The new test covers defined names and geth's spelling for undefined opcodes. Inspector all-feature release tests and Clippy passed.A follow-up on two pinned cores found a warm-workload tradeoff. On the router, geth's unmodified unigram script took 22.84 ms on main and 24.02 ms on this branch, while the simpler per-step opcode-name reader took 11.99 ms and 11.84 ms respectively. This draft targets fresh inspectors. The full-script regression merits consideration before merge.