HomePhabricator

Add benchmark to write JSON into a string

Description

Add benchmark to write JSON into a string

Summary:
The benchmark BlockToJsonVerbose only tests generating (and destroying)
the JSON data structure, but serializing into a string is also a
performance critical aspect of the RPC calls.

Also, use ankerl::nanobench::doNotOptimizeAway to make sure the compiler
can't optimize the result of the calls away.

This is a backport of core#21170
Depends on D13039

Test Plan: ninja bench-bitcoin

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13040

Details

Provenance
Martin Ankerl <martin.ankerl@gmail.com>Authored on Feb 13 2021, 09:17
PiRKCommitted on Jan 24 2023, 11:07
teamcityPushed on Jan 24 2023, 11:11
Parents
rSTAGING0724708e0da8: Fix BlockToJsonVerbose benchmark
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/37682, tag: phabricator/base/37676

Event Timeline