5 May
2015
5 May
'15
4:49 p.m.
TONGARI J
If the data sequence shows some affinity, I guess an ordered tuple_vector-based sequence can provide some performance benefit in traversal (with some crafted for_each method).
That is, a sequence of [AAABBB] may be traversed faster than [ABABAB] for such a container, and I believe in the later case such that the types are uniformly distributed, vector<variant> will perform better.
I wrote something on this some time ago, maybe worth having a look at: http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections.html http://bannalia.blogspot.com/2014/05/fast-polymorphic-collections-with.html Joaquín M López Muñoz Telefónica