mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-09 20:29:26 -04:00
Add script to test gcc profile-guided optimizations
This commit is contained in:
parent
99d6e72b89
commit
0776bc94d7
23
tools/pgo_build.sh
Executable file
23
tools/pgo_build.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Try gcc profile-guided optimizations
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
MAKE="make -j$(grep -c processor /proc/cpuinfo)"
|
||||||
|
DATAFILE="$HOME/data/silesia"
|
||||||
|
|
||||||
|
$MAKE benchmark > /dev/null
|
||||||
|
echo "====================="
|
||||||
|
echo "Original performance:"
|
||||||
|
echo "---------------------"
|
||||||
|
./benchmark "$@" "$DATAFILE"
|
||||||
|
|
||||||
|
$MAKE CFLAGS=-fprofile-generate LDFLAGS=-fprofile-generate benchmark > /dev/null
|
||||||
|
./benchmark "$@" "$DATAFILE" > /dev/null
|
||||||
|
$MAKE CFLAGS=-fprofile-use benchmark > /dev/null
|
||||||
|
rm -f {lib,programs}/*.gcda
|
||||||
|
echo "=========================="
|
||||||
|
echo "PGO-optimized performance:"
|
||||||
|
echo "--------------------------"
|
||||||
|
./benchmark "$@" "$DATAFILE"
|
Loading…
x
Reference in New Issue
Block a user