Open absolute8511 opened 3 years ago
@absolute8511 As SSE is a processor extension set, I would expect it to be disabled for portable builds for the reason that (I would guess) that not all processors have SSE. Does that make sense?
Yeah, I think it makes sense, and just to confirm. But I see it can be detected on the running machine, maybe it will not affect the portable?
@absolute8511 I guess at the moment it is decided at compile time rather than run time.
FWIW, for Facebook developers, USE_SSE=1 is default
build_tools/fbcode_config.sh:test "$USE_SSE" || USE_SSE=1
build_tools/fbcode_config.sh:export USE_SSE
And note (from build_detect_platform):
# The USE_SSE flag now means "attempt to compile with widely-available
# Intel architecture extensions utilized by specific optimizations in the
# source code." It's a qualifier on PORTABLE=1 that means "mostly portable."
# It doesn't even really check that your current CPU is compatible.
@absolute8511 As SSE is a processor extension set, I would expect it to be disabled for portable builds for the reason that (I would guess) that not all processors have SSE.
+1 (even though SSE is now ancient)
@absolute8511 I guess at the moment it is decided at compile time rather than run time.
Runtime detection is a PITA, so RocksDB code doing that is more exception than rule.
If you want "mostly" portable, USE_SSE=1 (along with default PORTABLE=1). If you want best optimizations for your CPU, PORTABLE=0. If you want truly portable for your platform, USE_SSE=0 (currently default).
I'll keep this open as a (reasonable) request to make USE_SSE=1 default for (at least) all Makefile users.
I build with the
the make_config.mk showed no -DHAVE_SSE42 will be used which will disable the fast crc32
While I build with the default
make static_lib
without using the PORTABLE, the content in the make_config.mk showedI can force using the sse by
USE_SSE=1 PORTABLE=1 make static_lib
.So, is it expected for a portable build?