Skip to content

Commit 97edd10

Browse files
committed
gold_benchmark: lld, less verbose output, more manageable sizes
1 parent 09cb7c9 commit 97edd10

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

linker/gold_benchmark/bench

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ set -eu
33
cflags='-ggdb3 -O0 -std=c99 -Wall -Wextra -pedantic'
44
output_file="${1:-res.log}"
55
rm -f "$output_file"
6-
/usr/bin/time --append --format 'nogold: wall=%es user=%Us system=%Ss %MkB' --output "$output_file" gcc $cflags -o main *.o
7-
/usr/bin/time --append --format 'gold: wall=%es user=%Us system=%Ss %MkB' --output "$output_file" gcc $cflags -fuse-ld=gold -o main *.o
6+
echo nogold
7+
/usr/bin/time --append --format 'nogold: wall=%es user=%Us system=%Ss %MkB' --output "$output_file" gcc $cflags -o main *.o
8+
echo gold
9+
/usr/bin/time --append --format 'gold: wall=%es user=%Us system=%Ss %MkB' --output "$output_file" gcc $cflags -fuse-ld=gold -o main *.o
10+
echo lld
11+
/usr/bin/time --append --format 'lld: wall=%es user=%Us system=%Ss %MkB' --output "$output_file" gcc $cflags -fuse-ld=lld -o main *.o

linker/gold_benchmark/bench-all

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ set -eu
33
result_log=result.log
44
rm -f "$result_log"
55
for params in \
6-
"10000 1 1" \
7-
"1 10000 1" \
8-
"1 1 10000" \
9-
"10000 10 1" \
10-
"1000 100 1" \
11-
"100 1000 1" \
126
"10000 10 10" \
137
"1000 100 10" \
148
"100 1000 10" \

linker/gold_benchmark/generate-objects

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cflags='-ggdb3 -O0 -std=c99 -Wall -Wextra -pedantic'
1818
# Cleanup previous generated files objects.
1919
./clean
2020

21-
# Generate i_*.c, ints.h and int_sum.h
21+
echo "Generate i_*.c, ints.h and int_sum.h"
2222
rm -f ints.h
2323
echo 'return' > int_sum.h
2424
int_file_i=0
@@ -27,7 +27,6 @@ while [ "$int_file_i" -lt "$n_int_file_is" ]; do
2727
int_file="${int_file_i}.c"
2828
rm -f "$int_file"
2929
while [ "$int_i" -lt "$n_ints_per_file" ]; do
30-
echo "${int_file_i} ${int_i}"
3130
int_sym="i_${int_file_i}_${int_i}"
3231
echo "unsigned int ${int_sym} = ${int_file_i};" >> "$int_file"
3332
echo "extern unsigned int ${int_sym};" >> ints.h
@@ -38,7 +37,7 @@ while [ "$int_file_i" -lt "$n_int_file_is" ]; do
3837
done
3938
echo '1;' >> int_sum.h
4039

41-
# Generate funcs.h and main.c.
40+
echo "Generate funcs.h and main.c."
4241
rm -f funcs.h
4342
cat <<EOF >main.c
4443
#include "funcs.h"
@@ -65,5 +64,5 @@ cat <<EOF >>main.c
6564
}
6665
EOF
6766

68-
# Generate *.o
69-
ls | grep -E '\.c$' | parallel --halt now,fail=1 -t --will-cite "gcc $cflags -c -o '{.}.o' '{}'"
67+
echo "Generate *.o"
68+
ls | grep -E '\.c$' | parallel --halt now,fail=1 --will-cite "gcc $cflags -c -o '{.}.o' '{}'"

0 commit comments

Comments
 (0)