Boost logo

Boost :

From: Martin Duvanel (martin.duvanel_at_[hidden])
Date: 2021-09-06 19:10:05


We are using boost::icl::interval_set with very large amounts of intervals, and we are having some performance issues.
Profiling showed that, in our use-case, a lot of time was spent on memory allocation/deallocation, and swapping std::set for boost::flat_set made a huge, positive difference.

We may have a very specific use-case, but would you consider a small modification to the library inside "boost/icl/impl_config.hpp", in order to open the door for other set/map implementations?

Here is the simple change we made to "boost/icl/impl_config.hpp" for this experiment:

  # define ICL_IMPL_SPACE boost::container
  # define ICL_IMPL_SPACE std
  # define ICL_IMPL_SPACE std

And then declaring the following before including:

namespace custom_icl
template <class Key, class T, class Compare, class Allocator>
using map = boost::container::flat_map<Key, T, Compare, Allocator>;
template <class Key, class Compare, class Allocator>
using set = boost::container::flat_set<Key, Compare, Allocator>;
} // namespace custom_icl

#define ICL_CUSTOM_IMPL_SPACE custom_icl

Would such a change make sense in your opinion? If that's the case, then I would be happy to participate in the contribution.
Thank you and best regards,
Martin Duvanel

Boost list run by bdawes at, gregod at, cpdaniel at, john at