Wladimir J. van der Laan
05e821ee19
Merge #21170 : bench: Add benchmark to write JSON into a string
...
e3e0a2432c587ee06e469c37ffae133b7ac55c77 Add benchmark to write JSON into a string (Martin Ankerl)
Pull request description:
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.
Extracts test setup into a `struct TestBlockAndIndex`, and uses it in
both `BlockToJsonVerbose` and `BlockToJsonVerboseWrite`.
Also, use `ankerl::nanobench::doNotOptimizeAway` to make sure the compiler
can't optimize the result of the calls away.
Here are benchmark results on my Intel i7-8700:
| ns/op | op/s | err% | ins/op | cyc/op | IPC | bra/op | miss% | total | benchmark
|--------------------:|--------------------:|--------:|----------------:|----------------:|-------:|---------------:|--------:|----------:|:----------
| 71,807,017.00 | 13.93 | 0.4% | 555,782,961.00 | 220,788,645.00 | 2.517 | 102,279,341.00 | 0.4% | 0.80 | `BlockToJsonVerbose`
| 27,916,835.00 | 35.82 | 0.1% | 235,084,034.00 | 89,033,525.00 | 2.640 | 42,911,139.00 | 0.3% | 0.32 | `BlockToJsonVerboseWrite`
ACKs for top commit:
laanwj:
Code review ACK e3e0a2432c587ee06e469c37ffae133b7ac55c77
Tree-SHA512: bc4d6d1588d47d4bd7af8e7908e44b8561bc391a2d73eccd7c0aa37fc40e8a9ce1fa1f3c29b416eef24a73c6bce3036839c0bbfe1b8dbd6d1bba3718b7ca5383
2021-03-01 19:12:09 +01:00
..
2021-03-01 19:12:09 +01:00
2021-02-23 12:51:50 +08:00
2020-12-31 09:45:41 +01:00
2020-12-08 19:26:30 +01:00
2021-01-24 16:28:27 +01:00
2021-02-11 11:39:45 +01:00
2021-01-07 18:07:09 +02:00
2021-02-18 14:49:06 -05:00
2021-01-03 18:38:31 +01:00
2020-12-31 09:45:41 +01:00
2021-02-28 13:14:04 +08:00
2021-03-01 11:45:42 +01:00
2021-02-18 21:51:16 +13:00
2020-10-27 23:08:48 -07:00
2021-02-01 15:17:28 +01:00
2021-02-25 14:42:48 +01:00
2020-11-19 15:48:24 +01:00
2021-02-24 09:57:21 +01:00
2021-03-01 11:45:42 +01:00
2021-01-28 08:19:52 +01:00
2021-02-18 10:07:37 +00:00
2021-02-18 15:08:35 +01:00
2020-12-31 09:45:41 +01:00
2021-01-29 15:39:44 +08:00
2021-01-29 12:39:55 +00:00
2020-12-31 09:45:41 +01:00
2021-02-18 15:08:35 +01:00
2020-07-03 20:43:55 -07:00
2021-01-31 17:35:16 +01:00
2020-12-31 09:45:41 +01:00
2020-11-18 12:00:57 -05:00
2021-02-15 20:01:52 +01:00
2020-11-18 12:00:57 -05:00
2020-12-10 11:12:08 +01:00
2021-01-12 18:34:25 +10:00
2021-01-18 18:33:24 +01:00
2020-11-18 12:00:57 -05:00
2021-01-21 19:31:28 +01:00
2020-11-18 12:00:57 -05:00
2020-12-15 17:21:06 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-02-12 07:53:29 -06:00
2021-02-18 09:40:42 +01:00
2021-02-12 07:53:22 -06:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-10-25 14:25:00 +01:00
2020-09-24 06:55:34 +03:00
2020-12-31 09:45:41 +01:00
2021-02-01 22:30:05 +02:00
2021-02-12 07:53:29 -06:00
2021-02-12 07:53:29 -06:00
2020-12-31 09:45:41 +01:00
2021-01-04 12:31:31 +08:00
2021-01-04 12:31:31 +08:00
2020-12-31 09:45:41 +01:00
2021-01-04 12:23:16 +08:00
2021-02-01 15:17:28 +01:00
2021-02-23 14:34:30 +01:00
2021-02-10 20:46:25 +00:00
2021-01-15 22:48:15 +01:00
2021-01-15 22:48:15 +01:00
2021-01-04 12:23:16 +08:00
2020-12-31 09:45:41 +01:00
2020-11-23 21:02:54 +00:00
2020-12-31 09:45:41 +01:00
2020-10-22 21:45:20 +03:00
2021-02-18 14:37:51 +01:00
2020-12-06 00:22:40 +00:00
2021-01-24 02:44:53 +01:00
2021-01-24 02:44:53 +01:00
2021-01-04 12:23:16 +08:00
2021-02-18 14:37:51 +01:00
2021-01-15 09:57:32 +00:00
2021-02-24 09:57:21 +01:00
2021-01-07 18:07:09 +02:00
2020-12-08 19:26:30 +01:00
2020-10-27 19:40:44 +01:00
2021-02-21 21:01:02 +02:00
2021-01-07 18:07:09 +02:00
2021-01-23 20:01:12 +01:00
2021-02-17 11:36:30 +01:00
2021-02-11 14:07:33 +01:00
2021-01-07 18:07:09 +02:00
2021-01-07 18:07:09 +02:00
2021-01-04 12:31:31 +08:00
2020-12-31 09:45:41 +01:00
2021-01-28 14:15:26 -05:00
2020-12-06 18:44:25 +00:00
2020-12-31 09:45:41 +01:00
2020-10-12 12:14:53 -07:00
2021-02-22 09:43:57 +01:00
2021-02-15 16:15:51 +00:00
2021-02-23 16:03:19 +01:00
2021-02-18 09:28:06 +00:00
2021-01-10 15:51:15 +01:00
2021-02-02 00:01:36 +01:00
2021-02-15 15:31:15 +01:00
2021-02-15 15:31:15 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-01-03 18:37:59 +01:00
2021-01-03 18:37:59 +01:00
2021-01-31 17:35:01 +01:00
2020-12-31 09:45:41 +01:00
2021-02-01 15:17:28 +01:00
2020-11-26 09:05:59 +00:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-01-31 17:35:16 +01:00
2020-12-08 16:47:36 +01:00
2021-02-18 07:53:37 +01:00
2021-01-13 02:05:00 +01:00
2021-01-29 15:39:44 +08:00
2020-10-09 10:32:19 +02:00
2021-02-22 14:17:24 +01:00
2020-12-31 09:45:41 +01:00
2020-09-22 22:31:31 +02:00
2020-09-22 22:31:31 +02:00
2020-11-25 15:18:33 +01:00
2021-02-01 15:17:28 +01:00
2021-01-26 15:57:28 +08:00
2021-01-12 15:56:19 +08:00
2020-12-31 09:45:41 +01:00
2020-10-12 19:50:16 -07:00
2020-12-01 18:36:39 +01:00
2021-02-11 14:07:33 +01:00
2020-12-31 09:45:41 +01:00
2021-02-12 07:53:32 -06:00
2020-07-01 14:44:24 -04:00
2021-02-24 09:57:21 +01:00
2021-02-24 09:57:21 +01:00
2020-12-01 18:36:39 +01:00
2020-10-12 12:14:53 -07:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2021-02-22 09:47:15 +01:00
2021-02-18 14:49:10 -05:00
2020-09-22 11:34:30 -04:00
2020-09-22 11:34:30 -04:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00
2020-12-31 09:45:41 +01:00