HomePhabricator

Merge #14298: [REST] improve performance for JSON calls

Description

Merge #14298: [REST] improve performance for JSON calls

Summary:
30973e9844 [REST] improve performance for JSON calls (Antoine Le Calvez)

Pull request description:

JSON calls do not use the raw data generated for the .bin and .hex calls.

By moving the raw data creation into the .bin and .hex switch branches, JSON calls' performance is improved.

Light benchmarking indicates that fetching 2000 JSON headers is ~25% faster, fetching large JSON blocks is ~4% faster.

Tree-SHA512: 433552c89bac2469d041b48a4a991d5443e4026a3ad7dc5621685386029f22826484218642fa5130c268349a55524ecbc4e30d64c867bd6632e0edd24370cf11

Backport of Core PR14298

Test Plan:
My computer is apparently too fast to measure these perf improvements reliably, but I tried this pre- and post-patch:

ninja check
bitcoind -rest
time curl localhost:8332/rest/headers/2000/<some-blockhash>.json
time curl localhost:8332/rest/block/<some-blockhash>.json

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Apr 22 2020, 17:53
jasonbcoxCommitted on Apr 22 2020, 17:57
jasonbcoxPushed on Apr 22 2020, 19:00
Reviewer
Restricted Project
Differential Revision
D5783: Merge #14298: [REST] improve performance for JSON calls
Parents
rSTAGING334205c83df6: [backport#12916] Introduce BigEndian wrapper and use it for netaddress ports
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/19024