Speed up object child lookup - #173
Merged
Merged
Conversation
Member
Author
|
@cubic-dev-ai review |
@rgerhards I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 23 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
rgerhards
force-pushed
the
codex/libfastjson-performance-analysis
branch
from
July 23, 2026 08:13
f131504 to
d02e65a
Compare
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
rgerhards
force-pushed
the
codex/libfastjson-performance-analysis
branch
3 times, most recently
from
July 23, 2026 09:18
d02e65a to
6b11f09
Compare
rgerhards
marked this pull request as ready for review
July 23, 2026 11:05
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.
What changed
_fjson_find_child()hot path with direct traversal of the existing child pagesWhy
Rsyslog's regular
$!varnamepath performs repeated libfastjson object lookups. Profiling attributed about 13-16% of the variable-heavy path to child lookup. The existing implementation paid iterator setup and function-call overhead for every comparison even though the private page representation is directly available here.Performance
Two standalone paired sessions, each with one calibration and 11 measured pairs, found:
Two full rsyslog sessions using 2,097,152 messages per trial found the following repeatable single-worker throughput changes:
$!reads: +9.68% / +13.53%$!writes: +6.84% / +6.18%Eight-worker results were neutral or noisy, and no conclusive rsyslog workload regressed above 5%. The change should therefore be presented as a useful lookup improvement, not a general double-digit rsyslog throughput claim.
Validation
make distcheckThe existing
tests/parse_flags.c-Wsizeof-array-divwarning was demoted from error during full local validation; it is unrelated to this change.Summary by cubic
Speeds up libfastjson object child lookup by walking child pages directly in
_fjson_find_child(), removing iterator overhead. Adds a reproducible microbenchmark suite and documents the traversal semantics.Refactors
_fjson_find_child()with direct child‑page traversal._fjson_find_child()explaining traversal rationale and case‑mode semantics.New Features
benchmarks/benchmark.c,runner.py,run.sh,README.md) with self‑tests; records calibration, medians/MAD, outliers, raw JSON, and build/source fingerprints; requires clean Git checkouts; ship runner, results, and reports viaMakefile.am.tests/test_charcase.c.Written for commit 9babea4. Summary will update on new commits.