Skip to content

Commit b62808b

Browse files
committed
Link against gmp,mpfr & enable PGO,LTO for up to 1.25x speedup
PGO workload is taken from [here](https://github.com/Tensibai/benchmark-awk-vs) **Benchmarking** Use a different benchmark for testing to ensure we aren't just optimizing for one workload. 1. Generate some data `yes 'SomeSampleText SomeOtherText 33 1970 YetAnotherText 777 abc 1 AndSomeMore' | head -12000000 > gawkdata.txt` 2. Benchmark `perf stat -r 5 gawk 'BEGIN {a = 0;} /YetAnotherText/ {a ++;} END {print "a: " a;}' gawkdata.txt` Before: 2.12259 +- 0.00260 seconds time elapsed ( +- 0.12% ) After : 1.59791 +- 0.00152 seconds time elapsed ( +- 0.10% )
1 parent 736a818 commit b62808b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gawk/stone.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ description : |
99
upstreams :
1010
- https://ftp.gnu.org/gnu/gawk/gawk-5.1.1.tar.xz: d87629386e894bbea11a5e00515fc909dc9b7249529dad9e6a3a2c77085f7ea2
1111
builddeps :
12+
- pkgconfig(gmp)
13+
- pkgconfig(mpfr)
1214
- make
1315
- clang
1416
- lld
@@ -25,3 +27,9 @@ install : |
2527
%install_file %(installroot)/etc/profile.d/* -t %(installroot)/%(vendordir)/profile.d/
2628
rm %(installroot)/etc/profile.d/*
2729
rmdir %(installroot)/etc/profile.d %(installroot)/etc
30+
workload : |
31+
./gawk 'BEGIN{for (i=1;i<=10000000;i++) print (i % 5?"miss":"hit"),i," third\t \tfourth"}' > file
32+
echo "/hit [[:digit:]]*0 / { print \$4, \$1, \$3 }" > test.awk
33+
./gawk -f test.awk file | ./gawk '!seen[$0]++{unq++;r=$0} END{print ((unq==1) && (seen[r]==1000000) && (r=="fourth hit third")) ? "PASS" : "FAIL"}'
34+
tuning :
35+
- lto

0 commit comments

Comments
 (0)