Boost logo

Boost Users :

From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2024-03-11 08:12:24


El 10/03/2024 a las 22:40, Ivan Matek via Boost-users escribió:
> Hi,
> I have some small maps where I am pretty sure SIMD tricks that are
> amazing in general will just slow down the lookups since I never
> lookup items not in the map and map is so small that benefits of not
> looking up into the big array and trashing the cache are miniscule.
> I know I can force compiler to not support SIMD with march, but I want
> to keep the SIMD optimizaitons for rest of the code, including large
> boost unordered objects.

Hi Ivan,

Boost.Unordered support can be disabled by globally defining the macro
BOOST_UNORDERED_DISABLE_SSE2, but this is probably not a solution for
you because:

* It disables SSE2 for *all* flat containers in Boost.Unordered.
* The alternative implementation to SSE2 is likely to be slower anyway.

May I suggest that you use boost::unordered_map instead of
boost::unordered_flat_map
for those small maps and see if this improves the performance of your
program?

Best,

Joaquín M López Muñoz



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net