| 
									
										
										
										
											2014-11-04 01:02:17 +02:00
										 |  |  | #~/bin/bash | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | #execute each bench 3 times and print the timing | 
					
						
							| 
									
										
										
										
											2014-12-20 18:57:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | exec 2>&1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | #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; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-12-20 18:57:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | #execute  given async tests 3 times (timing is already builtin) | 
					
						
							|  |  |  | bench_async () | 
					
						
							|  |  |  | {	 | 
					
						
							|  |  |  | 	echo "**************** $1 ****************" | 
					
						
							|  |  |  | 	for i in {1..3}; do  | 
					
						
							|  |  |  | 		./$1 $2;  | 
					
						
							| 
									
										
										
										
											2014-12-21 01:12:35 +02:00
										 |  |  | 		echo		 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | 		rm  -f logs/* | 
					
						
							|  |  |  | 		sleep 3 | 
					
						
							|  |  |  | 	done; | 
					
						
							|  |  |  | }   | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | echo "Single threaded benchmarks.. (1 thread,  1,000,000 lines)" | 
					
						
							|  |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | for exe in boost-bench glog-bench easylogging-bench spdlog-bench; | 
					
						
							|  |  |  | do | 
					
						
							|  |  |  | 	bench_exe $exe 1 | 
					
						
							|  |  |  | done; | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | echo "Multi threaded benchmarks.. (10 threads,  1,000,000 lines)" | 
					
						
							|  |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt spdlog-bench-mt; | 
					
						
							|  |  |  | do | 
					
						
							|  |  |  | 	bench_exe $exe 10 | 
					
						
							|  |  |  | done; | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | echo "Multi threaded benchmarks.. (100 threads,  1,000,000 lines)" | 
					
						
							|  |  |  | echo "----------------------------------------------------------" | 
					
						
							|  |  |  | for exe in boost-bench-mt glog-bench-mt easylogging-bench-mt spdlog-bench-mt; | 
					
						
							|  |  |  | do | 
					
						
							|  |  |  | 	bench_exe $exe 100 | 
					
						
							|  |  |  | done; | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | 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; | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | 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; | 
					
						
							| 
									
										
										
										
											2014-11-24 02:44:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-24 23:31:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-20 22:25:55 +02:00
										 |  |  | 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; | 
					
						
							| 
									
										
										
										
											2014-11-24 02:15:17 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-04 01:02:17 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 |