Still on the theme of "contiguous enables fast," a followup on the recent "Fast Polymorphic Collections" article:
Fast Polymorphic Collections with Devirtualization
by Joaquín M López Muñoz
From the article:
The
poly_collection
template class we implemented for fast handling of polymorphic objects can be potentially speeded up in the case where some of the derived classes it manages are known to the compiler at the point of template instantiation...Allowing for the specification of a list of statically known derived class types as part of a
poly_collection
instantiation opens up possibilities for internal performance optimizations that do not impact the usage interface of this template class. The actual improvements achieved depend very much on the compiler being used, but in general are greater when passing polymorphic functors (such as generic lambdas) tofor_each
and qualifying virtual functions asfinal
where possible.
Add a Comment
Comments are closed.