From 0d8b6f6cc4d418fecaf3e8333e50f68dc7e8a196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Fri, 31 Jul 2020 01:34:13 +0200 Subject: [PATCH] build scripts: disable avx512, since it decreases performance --- TODO.md | 2 -- scripts/bench-udp-handlers.sh | 10 +++++++++- scripts/run-aquatic-http.sh | 10 +++++++++- scripts/run-aquatic-udp.sh | 10 +++++++++- scripts/run-aquatic-ws.sh | 10 +++++++++- scripts/run-load-test-http.sh | 10 +++++++++- scripts/run-load-test-udp.sh | 10 +++++++++- 7 files changed, 54 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index 1d481cf..707fd81 100644 --- a/TODO.md +++ b/TODO.md @@ -5,8 +5,6 @@ * use ipv4-mapped address functions, but I should check that they really work as they really work as they should. All announces over ipv4 should go to ipv4 map, all over ipv6 to ipv6 map -* avx-512 should be avoided, maybe this should be mentioned in README - and maybe run scripts should be adjusted ## aquatic_http_load_test diff --git a/scripts/bench-udp-handlers.sh b/scripts/bench-udp-handlers.sh index 565268c..800c71e 100755 --- a/scripts/bench-udp-handlers.sh +++ b/scripts/bench-udp-handlers.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS"" cargo run --release --bin aquatic_udp_bench -- $@ \ No newline at end of file diff --git a/scripts/run-aquatic-http.sh b/scripts/run-aquatic-http.sh index a32c833..b6e048a 100755 --- a/scripts/run-aquatic-http.sh +++ b/scripts/run-aquatic-http.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS" cargo run --release --bin aquatic_http -- $@ diff --git a/scripts/run-aquatic-udp.sh b/scripts/run-aquatic-udp.sh index b0b1e16..a6cb97b 100755 --- a/scripts/run-aquatic-udp.sh +++ b/scripts/run-aquatic-udp.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS" cargo run --release --bin aquatic_udp -- $@ diff --git a/scripts/run-aquatic-ws.sh b/scripts/run-aquatic-ws.sh index b97b6eb..50ae675 100755 --- a/scripts/run-aquatic-ws.sh +++ b/scripts/run-aquatic-ws.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS" cargo run --release --bin aquatic_ws -- $@ diff --git a/scripts/run-load-test-http.sh b/scripts/run-load-test-http.sh index d97d627..b80e1a0 100755 --- a/scripts/run-load-test-http.sh +++ b/scripts/run-load-test-http.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS" cargo run --release --bin aquatic_http_load_test -- $@ \ No newline at end of file diff --git a/scripts/run-load-test-udp.sh b/scripts/run-load-test-udp.sh index 78a1a26..084822b 100755 --- a/scripts/run-load-test-udp.sh +++ b/scripts/run-load-test-udp.sh @@ -1,5 +1,13 @@ #!/bin/sh -export RUSTFLAGS="-C target-cpu=native" +# Compile with target-cpu=native but without AVX512 features, since they +# decrease performance. + +DISABLE_AVX512=$(rustc --print target-features | grep " avx512" | + awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs) + +export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512" + +echo "Compiling with RUSTFLAGS=$RUSTFLAGS" cargo run --release --bin aquatic_udp_load_test -- $@