FlatBuffers

This protocol is used for

  • Event-logs

You can run a performance test on your own server

conda install -y --channel https://roq-trading.com/conda/stable \
    roq-client

roq-client-benchmark --benchmark_filter="BM_FlatBuffers_*"

You should then be able to see something like this

-----------------------------------------------------------------------------------
Benchmark                                         Time             CPU   Iterations
-----------------------------------------------------------------------------------
BM_FlatBuffers_Encode_DownloadBegin             457 ns          457 ns      1149507
BM_FlatBuffers_Decode_DownloadBegin             160 ns          160 ns      4368660
BM_FlatBuffers_Encode_DownloadEnd               482 ns          482 ns      1458849
BM_FlatBuffers_Decode_DownloadEnd               172 ns          172 ns      4073939
BM_FlatBuffers_Encode_MarketDataStatus          417 ns          417 ns      1645019
BM_FlatBuffers_Decode_MarketDataStatus          161 ns          161 ns      4344783
BM_FlatBuffers_Encode_OrderManagerStatus        484 ns          484 ns      1448876
BM_FlatBuffers_Decode_OrderManagerStatus        174 ns          174 ns      4016440
BM_FlatBuffers_Encode_ReferenceData             967 ns          967 ns       713299
BM_FlatBuffers_Decode_ReferenceData             336 ns          336 ns      2153250
BM_FlatBuffers_Encode_MarketStatus              557 ns          557 ns      1256013
BM_FlatBuffers_Decode_MarketStatus              190 ns          190 ns      3693687
BM_FlatBuffers_Encode_TopOfBook                 751 ns          751 ns       943506
BM_FlatBuffers_Decode_TopOfBook                 270 ns          270 ns      2578129
BM_FlatBuffers_Encode_MarketByPrice            1713 ns         1713 ns       401531
BM_FlatBuffers_Decode_MarketByPrice             526 ns          526 ns      1335859
BM_FlatBuffers_Encode_MarketByOrder            2602 ns         2602 ns       260247
BM_FlatBuffers_Decode_MarketByOrder             934 ns          934 ns       729378
BM_FlatBuffers_Encode_TradeSummary             1446 ns         1446 ns       452628
BM_FlatBuffers_Decode_TradeSummary              481 ns          481 ns      1422111
BM_FlatBuffers_Encode_StatisticsUpdate         1148 ns         1148 ns       646561
BM_FlatBuffers_Decode_StatisticsUpdate          366 ns          366 ns      1974883
BM_FlatBuffers_Encode_CreateOrder               911 ns          911 ns       828482
BM_FlatBuffers_Decode_CreateOrder               331 ns          331 ns      2128987
BM_FlatBuffers_Encode_ModifyOrder               536 ns          536 ns      1283277
BM_FlatBuffers_Decode_ModifyOrder               196 ns          196 ns      3573061
BM_FlatBuffers_Encode_CancelOrder               540 ns          540 ns      1438091
BM_FlatBuffers_Decode_CancelOrder               174 ns          174 ns      3933398
BM_FlatBuffers_Encode_OrderAck                  765 ns          765 ns       846593
BM_FlatBuffers_Decode_OrderAck                  284 ns          284 ns      2393125
BM_FlatBuffers_Encode_OrderUpdate              1001 ns         1001 ns       726074
BM_FlatBuffers_Decode_OrderUpdate               344 ns          344 ns      2066295
BM_FlatBuffers_Encode_TradeUpdate              1968 ns         1968 ns       363939
BM_FlatBuffers_Decode_TradeUpdate               668 ns          668 ns      1068433
BM_FlatBuffers_Encode_PositionUpdate            747 ns          747 ns       927492
BM_FlatBuffers_Decode_PositionUpdate            262 ns          262 ns      2670614
BM_FlatBuffers_Encode_FundsUpdate               573 ns          573 ns      1192972
BM_FlatBuffers_Decode_FundsUpdate               199 ns          199 ns      3520090

Note

These metrics are at least one magnitude larger than similar metrics using the native protocol.