
9 Oct
2013
9 Oct
'13
10:27 a.m.
Rahul Mathur wrote:
I wish to record 1000 real time data which need to be in sorted order.
I used STL MAP which sorts using KEYS and than sorted the value using STL VECTOR, the complete scenario give me almost 6ms of time analysis. The TARGET is to achieve almost 1.5 - 2.0 ms.
Also, once this data structure is completely filled I want to delete the first data and replace it with the new data.
For mere 1k records, recommend multi_index with freshness measure as one index, and second index on extracted key. Don't recommend optimizing for the non-bottleneck, either. Can be replaced with something more involved once it's known to be the limiting case. -sh