Skip to content

Conversation

@LalitMaganti
Copy link
Member

@LalitMaganti LalitMaganti commented May 24, 2025

This CL moves away from using jsoncpp as much as possible in trace processor for performance reasons. Turns out jsoncpp really sucks very badly and with a few hundred lines of code, we can destroy it in benchmarks.

Before:

[898.916] processor_shell.cc:1878 Trace loaded: 453.80 MB in 22.06s (20.6 MB/s)

After:

[928.441] processor_shell.cc:1878 Trace loaded: 453.80 MB in 2.56s (177.1 MB/s)

There should be little-no functional change as a result of this CL. I've added a bunch of tests which pass both before and after to try and ensure there is no behavioural change. It's possible that there are some bugs of course but given the huge perf wins here, I think it's worth landing.

@LalitMaganti LalitMaganti requested review from a team as code owners May 24, 2025 03:40
@LalitMaganti LalitMaganti requested review from aMayzner and rsavitski and removed request for aMayzner and rsavitski May 24, 2025 03:40
@LalitMaganti LalitMaganti force-pushed the dev/lalitm/json branch 3 times, most recently from d31096a to 76d91e4 Compare May 28, 2025 04:54
@LalitMaganti LalitMaganti requested a review from a team as a code owner May 28, 2025 04:54
@LalitMaganti LalitMaganti changed the title [DNS] tp: speed up JSON tokenization/parsing by 4.5x tp: speed up JSON tokenization/parsing by ~9x May 28, 2025
@LalitMaganti LalitMaganti requested a review from aMayzner May 28, 2025 04:57
@LalitMaganti LalitMaganti requested a review from stevegolton May 28, 2025 05:00
@LalitMaganti
Copy link
Member Author

+Steve as an FYI.

Switch away from jsoncpp which has atrocious perf for parsing in favour
of writing our own parser. Moreover, remove some uses of a poor quality
json value fetch function in favour of our own.

test

Fix

fix

fix
@LalitMaganti LalitMaganti merged commit 125877b into main May 28, 2025
19 checks passed
@LalitMaganti LalitMaganti deleted the dev/lalitm/json branch May 28, 2025 17:11
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