JSON¶
Using propritary implementation designed to be cache friendly and avoid memory allocations.
Gateways may bundle tool to compute benchmark metrics, e.g.
conda install -y --channel https://roq-trading.com/conda/stable \
roq-coinbase-pro
roq-coinbase-pro-benchmark --benchmark_filter="BM_json_*"
You should then be able to see something like this
----------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------
BM_json_activate_parse 1006 ns 1006 ns 639545
BM_json_change_parse 807 ns 807 ns 867917
BM_json_currency_parse 1457 ns 1457 ns 482842
BM_json_done_parse 720 ns 720 ns 978864
BM_json_error_parse 129 ns 129 ns 5415727
BM_json_fill_parse 829 ns 829 ns 845393
BM_json_fills_parse 874 ns 874 ns 783098
BM_json_heartbeat_parse 377 ns 377 ns 1840688
BM_json_l2update_parse 468 ns 468 ns 1504435
BM_json_last_match_parse 806 ns 806 ns 871001
BM_json_match_parse 836 ns 835 ns 843789
BM_json_open_parse 752 ns 752 ns 936092
BM_json_order_parse 1390 ns 1390 ns 503734
BM_json_orders_parse 3025 ns 3025 ns 241082
BM_json_product_parse 1311 ns 1311 ns 533234
BM_json_products_parse 6707 ns 6706 ns 105034
BM_json_received_parse 888 ns 888 ns 789247
BM_json_snapshot_parse 16730 ns 16729 ns 41738
BM_json_status_parse 16896 ns 16895 ns 41532
BM_json_subscriptions_parse 964 ns 964 ns 708601
BM_json_ticker_parse 1020 ns 1020 ns 690184
Note
The JSON decoder is proprietary and will not be described any further here.