From 3f1cf58c3ecb1a10ffb2dde4a27d3a1865db7647 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 11 Jan 2008 00:44:22 +0000 Subject: [PATCH] Script that times 100 compilations of a hello world C program. Under Haiku it is rather slow (on my machine about 80% slower than on Zeta) and sometimes a compilation even fails, due to what looks to me like a problem with gcc's subprocess synchronization (our wait()/waitpid() or friends might have some race condition). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23371 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/system/benchmarks/compile_bench.sh | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 src/tests/system/benchmarks/compile_bench.sh diff --git a/src/tests/system/benchmarks/compile_bench.sh b/src/tests/system/benchmarks/compile_bench.sh new file mode 100755 index 0000000000..07bf6018e1 --- /dev/null +++ b/src/tests/system/benchmarks/compile_bench.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +testDir=/tmp/compile_bench +rm -rf $testDir +mkdir -p $testDir +cd $testDir + +cat << EOF > hello_world.cpp +#include + +int +main() +{ + printf("Hello world!\n"); + return 0; +} + +EOF + +compile_all() +{ + for f in $(seq 100); do + echo -n . + g++ -o $f ${f}.cpp + done +} + +for f in $(seq 100); do + cp hello_world.cpp ${f}.cpp +done + +time compile_all + +rm -rf $testDir