feat: add flatPaths optimization for JSON parsing - #76
Merged
Merged
Conversation
Contributor
PR Reviewer Guide 🔍(Review updated until commit f28aee7)Here are some key observations to aid the review process:
|
Contributor
Benchmark ComparisonBase: BenchmarkMainParse results |
Contributor
PR Code Suggestions ✨No code suggestions found for the PR. |
|
Contributor
|
Persistent review updated to latest commit f28aee7 |
Contributor
PR Code Suggestions ✨No code suggestions found for the PR. |
Merged
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.



PR Type
Enhancement, Bug fix, Tests
Description
Optimize parsing of small root-level JSON path sets.
Preserve generic parsing for unsupported or malformed input.
Propagate percentile append errors.
Add parity tests and comparative benchmarks.
Diagram Walkthrough
File Walkthrough
main.go
Track eligibility for flat JSON path parsingcmd/mackerel-plugin-jsonl/main.go
flatPathsto parser options.parser.go
Parse flat JSON paths with early terminationcmd/mackerel-plugin-jsonl/parser.go
ObjectEach, stopping once allrequested paths are found.
EachKeyon parsing errors without delivering alreadymatched values twice.
reader.go
Select flat paths and propagate append errorscmd/mackerel-plugin-jsonl/reader.go
main_test.go
Benchmark flat parsing against generic key parsingcmd/mackerel-plugin-jsonl/main_test.go
EachKeyparser for comparison.requireassertions in benchmark setup and validation.parser_test.go
Test flat parser parity and path eligibilitycmd/mackerel-plugin-jsonl/parser_test.go
EachKeyacross escaped, duplicate, missing,compound, and array cases.