Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_find: make implementation much shorter #18

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Conversation

davidhewitt
Copy link
Collaborator

This rewrites jiter_json_find to avoid function calls and instead use tight loops to descend the state. Hopefully a win for both simplicity and performance.

Copy link
Collaborator

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

It would probably be good to add some benchmarks before we go too much further, but I guess that can wait until after this.

@davidhewitt
Copy link
Collaborator Author

It would probably be good to add some benchmarks before we go too much further, but I guess that can wait until after this.

  • Codspeed, I assume?

@davidhewitt
Copy link
Collaborator Author

I pushed a starting point for some benchmarks.

When comparing against main, these show a slight improvement from this branch:

json_contains           time:   [39.840 ns 40.145 ns 40.469 ns]
                        change: [-6.1430% -5.1358% -4.1790%] (p = 0.00 < 0.05)
                        Performance has improved.

json_get_str            time:   [55.527 ns 55.875 ns 56.233 ns]
                        change: [-3.8639% -2.8376% -1.6959%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
  3 (3.00%) high mild
  3 (3.00%) high severe

@davidhewitt davidhewitt enabled auto-merge (squash) June 25, 2024 10:15
@davidhewitt davidhewitt merged commit d041a72 into main Jun 25, 2024
7 checks passed
@davidhewitt davidhewitt deleted the dh/json-find branch June 25, 2024 10:16
@samuelcolvin
Copy link
Collaborator

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants