On Monday 09 February 2015 15:56:28 Sean Harmer wrote: [...] > I guess depending upon the sizes of your key and value types and number of > elements and typical frequencies of operations (inserts vs lookups vs > removals) it may also possibly be better to use two vectors, one for the > keys and one for the values. > > The rationale being that if your value type is large you reduce the number > of key values that can be stored in a cache line and therefore incur more > cache misses when performing lookups. Of course you would still incur at > least one cache miss when loading in the value to return. > > It's surprising just how expensive cache misses are these days compared to > traditionally thought-to-be-expensive CPU instructions. > > Anyway, if somebody does implement a nice wrapper around such sorted > vectors with sufficient controls to force/not-force the sorted invariant > to allow efficient insertion/removal vs efficient lookups, we have a ton > of places in Qt3D where you could test such a beast. :)
Ah, the pleasure! Someone not only understands the arguments, but lifts them to the next level, too. This one is for you: https://codereview.qt-project.org/105743 (completely unfinished, you can't even remove elements) -- Marc Mutz <[email protected]> | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-Independent Software Solutions _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
