For local development, or just fixed hardware, it would be nice to take advantage of the fact that one is not distributing the binaries but compiling them locally. Being able to add --target-cpu=native to RUSTFLAGS would make some code even faster.
This is particularly helpful in numeric code where you can get the compiler to use SIMD automatically, making rustimport a stronger alternative to Numba, which already takes advantage of current CPU features by default.
It's unclear whether this should be on by default. Certainly you want it off anytime you are building on one machine and running the resulting code an arbitrary different machine, because you might end up generating code that won't run on other CPUs with different instruction sets (e.g. not all x86-64 CPUs have AVX-512 or AVX2).
For local development, or just fixed hardware, it would be nice to take advantage of the fact that one is not distributing the binaries but compiling them locally. Being able to add
--target-cpu=nativeto RUSTFLAGS would make some code even faster.This is particularly helpful in numeric code where you can get the compiler to use SIMD automatically, making
rustimporta stronger alternative to Numba, which already takes advantage of current CPU features by default.It's unclear whether this should be on by default. Certainly you want it off anytime you are building on one machine and running the resulting code an arbitrary different machine, because you might end up generating code that won't run on other CPUs with different instruction sets (e.g. not all x86-64 CPUs have AVX-512 or AVX2).