Page MenuHomePhabricator

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

Authored by jasonbcox on Apr 20 2020, 18:27.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Apr 20 2020, 18:45