run_all.sh 2.19 KB
Newer Older
gabime's avatar
gabime committed
1
#~/bin/bash
2
#execute each bench 3 times and print the timing
gabime's avatar
gabime committed
3 4 5

exec 2>&1

6 7 8 9 10 11 12 13 14 15
#execute and time given exe 3 times 
bench_exe ()
{	
	echo "**************** $1 ****************"
	for i in {1..3}; do 
		time ./$1 $2; 
		rm  -f logs/*
		sleep 3
	done;
}
gabime's avatar
gabime committed
16

17 18 19 20 21 22
#execute  given async tests 3 times (timing is already builtin)
bench_async ()
{	
	echo "**************** $1 ****************"
	for i in {1..3}; do 
		./$1 $2; 
gabime's avatar
gabime committed
23
		echo		
24 25 26
		rm  -f logs/*
		sleep 3
	done;
27
}
gabime's avatar
gabime committed
28 29


30 31 32
echo "----------------------------------------------------------"
echo "Single threaded benchmarks.. (1 thread,  1,000,000 lines)"
echo "----------------------------------------------------------"
33
for exe in boost-bench glog-bench easylogging-bench zf_log-bench spdlog-bench;
34 35 36
do
	bench_exe $exe 1
done;
gabime's avatar
gabime committed
37

38 39 40
echo "----------------------------------------------------------"
echo "Multi threaded benchmarks.. (10 threads,  1,000,000 lines)"
echo "----------------------------------------------------------"
41
for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt zf_log-bench-mt spdlog-bench-mt;
42 43 44
do
	bench_exe $exe 10
done;
gabime's avatar
gabime committed
45

46 47 48
echo "----------------------------------------------------------"
echo "Multi threaded benchmarks.. (100 threads,  1,000,000 lines)"
echo "----------------------------------------------------------"
49
for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt zf_log-bench-mt spdlog-bench-mt;
50 51 52
do
	bench_exe $exe 100
done;
gabime's avatar
gabime committed
53

54 55 56 57 58 59 60
echo "---------------------------------------------------------------"
echo "Async, single threaded benchmark.. (1 thread,  1,000,000 lines)"
echo "---------------------------------------------------------------"
for exe in spdlog-async g2log-async
do
	bench_async $exe 1
done;
gabime's avatar
gabime committed
61

62 63 64 65 66 67 68
echo "---------------------------------------------------------------"
echo "Async, multi threaded benchmark.. (10 threads,  1,000,000 lines)"
echo "---------------------------------------------------------------"
for exe in spdlog-async g2log-async
do
	bench_async $exe 10
done;
gabime's avatar
gabime committed
69

70 71 72 73 74 75 76
echo "---------------------------------------------------------------"
echo "Async, multi threaded benchmark.. (100 threads,  1,000,000 lines)"
echo "---------------------------------------------------------------"
for exe in spdlog-async g2log-async
do
	bench_async $exe 100
done;