shithub: 9bench

Download patch

ref: 4f82fa5701c1676f78c6aa123cc68e76d0e3e694
parent: 3f899338e54ae7ed97d980838a0c40e350718405
author: Ori Bernstein <[email protected]>
date: Thu Sep 29 20:13:28 EDT 2022

add basic syscall benchmark

--- a/test.c
+++ b/test.c
@@ -35,6 +35,17 @@
 }
 
 void
+benchsyscall(B *b)
+{
+	int i;
+
+	extern int sysr1(void);
+	for(i = 0; i < b->N; i++) {
+		(void)sysr1();
+	}
+}
+
+void
 benchmallocfree32(B *b)
 {
 	int i;
@@ -202,6 +213,8 @@
 main(void)
 {
 	benchinit();
+
+	bench("syscall", benchsyscall);
 
 	bench("mallocfree32", benchmallocfree32);
 	bench("rand", benchrand);