Hi everyone,
I am trying to design a component that inputs futures tick data from rithmic feed/RApi [C++11, Linux]. I want to capture the tick data for approximately 40 contacts live (off course, half of them are low liquidity forward contacts anyway). I have this rithmic call back routine that returns me tick data and now, I am trying to figure out whats the best data structure that that I can use to quickly retrieve and fill in the appropriate contract object. I would like this process to be as optimized as possible.
One simple way is to use std::map<contract name, object>/std::unordered_map... but I always tend to be a little suspicious about using STL libraries in critical paths. The other idea is to develop a balanced binary/RB tree by hand... which can be done. Before I pick and choose a path, I was wondering how any of you have addressed this issue and what your experiences/insights are.
Although my strategies don't need low latency... its good to design so that I don't have to bother revisiting this area in future in case I develop low latency (Absolute NO NO to HTF strategies!) strategies.... and I might even co-locate this system. Any advice is highly appreciated.
thanks
I am trying to design a component that inputs futures tick data from rithmic feed/RApi [C++11, Linux]. I want to capture the tick data for approximately 40 contacts live (off course, half of them are low liquidity forward contacts anyway). I have this rithmic call back routine that returns me tick data and now, I am trying to figure out whats the best data structure that that I can use to quickly retrieve and fill in the appropriate contract object. I would like this process to be as optimized as possible.
One simple way is to use std::map<contract name, object>/std::unordered_map... but I always tend to be a little suspicious about using STL libraries in critical paths. The other idea is to develop a balanced binary/RB tree by hand... which can be done. Before I pick and choose a path, I was wondering how any of you have addressed this issue and what your experiences/insights are.
Although my strategies don't need low latency... its good to design so that I don't have to bother revisiting this area in future in case I develop low latency (Absolute NO NO to HTF strategies!) strategies.... and I might even co-locate this system. Any advice is highly appreciated.
thanks
Last edited:
] initially, use containers in the critical code, find out that they need to make the code run faster… experiment with replacing containers and then find out that traditional C data structures dramatically improve performance.