Lookup on nested boost multi_index_container

前端 未结 3 2049
谎友^
谎友^ 2021-01-27 03:09

Consider following code

struct VersionData
{
    VersionData();
    VersionData(VersionData&& rhs);
    int     m_versionId;
    int     m_weight;
    in         


        
3条回答
  •  旧巷少年郎
    2021-01-27 04:04

    It is not the exact answer which I originally asked but since the performance issue was mentioned and in light of discussion with @sehe this is what I found.
    1) use flat structure, you can save wasting memory on the same keys using boost::flyweight
    2) use MIC instead of tailored containers, MIC might be slightly slower (depends on test scenario) when searching on simple indexes, but once you use composite keys (and implement similar behavior for your tailored datastructure) it is from slightly to significantly faster than tailored DS
    My previous statement that tailored one is faster is wrong, since I was using MIC from boost 1.52 and looks like there was a bug when using composite keys with strings (5 orders of magnitude slower than composite without string). When switched to 1.57 everything started to work as expected.

    Tests on Coliru
    Have a nice indexing, guys! :)

提交回复
热议问题