By default RocksDB extensively employs CRC32. It has two paths
for the checksum calculation:
* rocksdb::crc32c::Slow_CRC32,
* rocksdb::crc32c::Fast_CRC32.
The fast path depends on a run-time discovery of CPU capabilities
AND a compile-time define __SSE4_2__. Although my systems really
offer SSE4.2 support, the macro was undefined resulting in poor
RocksDB performance visible especially during WAL transactions.
The patch (awkwardly) adds the -msse4.2 to CXXFLAGS for RocksDB.
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
endif(WITH_CCACHE AND CCACHE_FOUND)
+ # We really want to have the CRC32 calculation in RocksDB accelerated
+ # with SSE 4.2. For details refer to rocksdb/util/crc32c.cc.
+ if (HAVE_INTEL_SSE4_2)
+ list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${SIMD_COMPILE_FLAGS})
+ endif()
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_AR=${CMAKE_AR})
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})