diff --git a/.cargo/config b/.cargo/config index d59b03bf2..7f7e28a8b 100644 --- a/.cargo/config +++ b/.cargo/config @@ -2,6 +2,11 @@ stacks-node = "run --package stacks-node --" fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module" +# Uncomment to improve performance slightly, at the cost of portability +# * Note that native binaries may not run on CPUs that are different from the build machine +# [build] +# rustflags = ["-Ctarget-cpu=native"] + # Needed by perf to generate flamegraphs. #[target.x86_64-unknown-linux-gnu] #linker = "/usr/bin/clang" diff --git a/README.md b/README.md index e1b79a887..3f91b1a9f 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,19 @@ cargo build --release cargo build --profile release-lite ``` +_Note on building_: you may set `RUSTFLAGS` to build binaries for your native cpu: + +``` +RUSTFLAGS="-Ctarget-cpu=native" +``` + +or uncomment these lines in `./cargo/config`: + +``` +# [build] +# rustflags = ["-Ctarget-cpu=native"] +``` + ## Testing **Run the tests:**