Repository navigation
JSON logs 5x faster, IIS 2.4x - #8
Merged
Merged
Conversation
A JSON line is read by a small scanner into a flat node list instead of an fpjson tree; lines it does not take exactly as fpjson would go to fpjson, whose tree becomes the same node list (one extraction path). On 200,007 lines the node lists equal fpjson's. ApacheEscape returns its input when there is nothing to escape, and the line time is formatted once per second. nginx JSON 19-21k -> 91-100k lines/s, IIS 54-59k -> 127-150k. Non-ASCII is now kept (fpjson turned raw UTF-8 into '?' and \u00e9 into an ANSI byte); it is logged as \xhh, as Apache does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJFY41846T15QqxmGW2
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.
Speed on one core,
--test, rules only:mainEvery decision line (
-v) is identical tomainon the JSON, IIS, typical and flood files, and the three formats still agree with each other inbench/formats.py.Changes
ip:portall work as before.\uescapes, duplicate keys, nesting deeper than 16,-0or leading zeros, integers over 18 digits, or trailing text. fpjson's tree is converted into the same node list, so there is still only one extraction path.ApacheEscape(shared with IIS): it returns its input unchanged when there's nothing to escape, which is nearly always, and otherwise writes in place.Checked against fpjson
TryStrToFloatorStrToIntDefand get the same result either way.ApacheEscapeis checked against its definition on all 256 byte values.One deliberate difference: non-ASCII
fpjson turned raw UTF-8 into
?plus stray bytes, andéinto a single ANSI byte, which corrupted non-ASCII user agents and paths before the signatures saw them. The scanner keeps the bytes and decodes\uescapes to UTF-8.ApacheEscapethen logs them as\xhh, the way Apache does. nginx'sescape=jsononly writes\u00XXfor control characters, and there both parsers agree.Unit tests: 177 checks, 0 failed (24 new). Iteration notes are in
bench/results/iter8-json/README.md.Generated by Claude Code