- Data structures that are contained within a single cache-line are more efficient.
- Use appropriate containers (e.g. prefer reserved std::vector than std::list)
- Organize your data to avoid alignment holes (sorting your struct members by decreasing size is one way)
- Donβt neglect the cache in data structure and algorithm design
- Use smaller data types
- Beware of the standard dynamic memory allocator, which may introduce holes and spread your data around in memory as it warms up
- Make sure all adjacent data is actually used in the hot loops. Otherwise, consider breaking up data structures into hot and cold components, so that the hot loops use hot data.
- Avoid algorithms and datastructures that exhibit irregular access patterns, and favor linear datastructures.
- Know and exploit the implicit structure of data
Ariel Silahian
http://www.sisSoftwareFactory.com/quant
https://twitter.com/sisSoftware
Never Miss an Update
Get notified when we publish new analysis on HFT, market microstructure, and electronic trading infrastructure. No spam.
Subscribe by EmailHFT Systems Architect & Consultant | 20+ years architecting high-frequency trading systems. Author of "Trading Systems Performance Unleashed" (Packt, 2024). Creator of VisualHFT.
I help financial institutions architect high-frequency trading systems that are fast, stable, and profitable.
>> Learn more about what I do:
https://hftAdvisory.com
>> Your execution logs contain $200K+ in recoverable edge.
>> Microstructure Diagnostics β one-time audit, 3-5 day turnaround
https://hftadvisory.com/microstructure-diagnostics
... more info about me π