Published: March 7, 2023
2
4
26

1/ Why do we use #rustlang for crypto HFT? It's just the best systems language, full stop. Here's a simple example: Zero-copy deserialization. Using this parsing trick, our historical data preprocessing is 10% faster. Look at the code: it's as simple as annotating a lifetime

Image in tweet by jeff.hl

2/ Some more context: The parsed struct will have references to the raw data instead of allocating new objects in memory. As long as you only use the struct for as long as the raw data lives, it just works. Any #cplusplus maxis around want to compare code on this?

3/ This doesn't matter much for live trading because parsing is trivially parallelizable and not the throughput bottleneck. But when replaying historical data, you want deterministic ordering of messages, and parsing directly impacts how long those pesky cron jobs take.

4/ This was just the simplest example I could think of. Let me know in the comments if there are any rust specifics people want to hear about in the context of HFT.

Share this thread

Read on Twitter

View original thread

Navigate thread

1/4