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

Restore the serialization benchmark program #406

Merged
merged 1 commit into from
May 16, 2024

Conversation

Neverlord
Copy link
Member

Bring back our serialization benchmark suite. I didn't just bring back the old version but also added a benchmark for the JSON serialization. The benchmark now gives us insights into the performance of our binary serialization of broker::variant and also the conversion to and from JSON.

Example run from my machine:

2024-05-12T16:29:04+02:00
Running ./build/broker/release/bin/broker-serialization-benchmark
Run on (12 X 24 MHz CPU s)
CPU Caches:
  L1 Data 64 KiB
  L1 Instruction 128 KiB
  L2 Unified 4096 KiB (x12)
Load Average: 12.03, 7.75, 5.86
----------------------------------------------------------------------
Benchmark                            Time             CPU   Iterations
----------------------------------------------------------------------
serialization/save_binary/0        123 ns          122 ns      5803397
serialization/save_binary/1        450 ns          446 ns      1570570
serialization/save_binary/2      15711 ns        15552 ns        45018
serialization/load_binary/0        129 ns          128 ns      5480353
serialization/load_binary/1        321 ns          318 ns      2202747
serialization/load_binary/2      37771 ns        37617 ns        18771
serialization/save_json/0          296 ns          293 ns      2370671
serialization/save_json/1         2832 ns         2812 ns       248191
serialization/save_json/2        86197 ns        85364 ns         8239
serialization/load_json/0          688 ns          684 ns      1015317
serialization/load_json/1         6476 ns         6421 ns       108800
serialization/load_json/2       186555 ns       184783 ns         3786

It's to be expected that JSON adds run-time overhead. But I think the slow-down is actually quite reasonable for Broker, better than I had expected.

@Neverlord Neverlord merged commit 9288b10 into master May 16, 2024
20 checks passed
@Neverlord Neverlord deleted the topic/neverlord/restore-serialization-benchmark branch May 16, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants