CRoaring icon indicating copy to clipboard operation
CRoaring copied to clipboard

Replace ROARING_DISABLE_AVX and ROARING_DISABLE_NATIVE options

Open lemire opened this issue 7 years ago • 1 comments

@andreigudkov proposed we do the following:

  • Remove entirely ROARING_DISABLE_AVX and ROARING_DISABLE_NATIVE options
  • For conditional compilation, use #ifdef AVX2
  • To select target architecture, use CMAKE_C_FLAGS

I think that this is good and simpler. However, I had a counterpoint:

If you do not specify anything, then by default AVX2 and popcnt support will be disabled on many common compilers. That's the wrong default for us IMHO. And very few people will ever bother to compile with flags unless they are specifically being told. The net result when you compile C with a generic cpu model, is that you miss a lot of optimizations that a language like Java gets thanks to JIT compilation. That's fine in many cases, as lots of software does not benefit much from advanced cpu features... but CRoaring is optimized for advanced cpu features. Disabling them by default is a shame. I think that at a minimum you would want to have the build system issue a stern warning when compiling on x64 with a generic cpu model. It is simply not going to be the right default for many people, for CRoaring.

lemire avatar Aug 31 '18 16:08 lemire

Note that the latest release introduced runtime dispatch which takes away my argument. We can definitively remove ROARING_DISABLE_AVX and ROARING_DISABLE_NATIVE at this time.

lemire avatar Apr 14 '21 22:04 lemire