From e4c9822d78543f041b396ce75251d73bba0e433d Mon Sep 17 00:00:00 2001 From: Donovan Hide Date: Fri, 31 Oct 2014 18:33:16 +0000 Subject: [PATCH] Enable processor-specific optimizations when available: The SConstruct is modified to enable processor specific optimizations on clang and gcc toolchains. This improves the performance of RocksDB's CRC function. It might also enable other used libraries that are in the codebase now or in the future to apply cpu-specific optimisations. The mtune option ensures that a binary compiled on one machine will function on another, --- SConstruct | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 31611e087..f9e960121 100644 --- a/SConstruct +++ b/SConstruct @@ -332,7 +332,9 @@ def config_env(toolchain, variant, env): if variant == 'release': env.Append(CCFLAGS=[ '-O3', - '-fno-strict-aliasing' + '-fno-strict-aliasing', + '-march=native', + '-mtune=native' ]) if toolchain != 'msvc':