@@ -15,27 +15,30 @@ This benchmark measures the latency of selected kernel capabilities, including:
1515* Time it takes to resume a suspended thread
1616* Time it takes to create a new thread (without starting it)
1717* Time it takes to start a newly created thread
18+ * Measure average time to alloc memory from heap then free that memory
1819
1920
2021Sample output of the benchmark::
2122
22- *** Booting Zephyr OS build zephyr-v2.3 .0-2257-g0f420483db07 ***
23+ *** Booting Zephyr OS build zephyr-v2.6 .0-1119-g378a1e082ac5 ***
2324 START - Time Measurement
24- Timing results: Clock frequency: 120 MHz
25- Average thread context switch using yield : 420 cycles , 3502 ns
26- Average context switch time between threads (coop) : 429 cycles , 3583 ns
27- Switch from ISR back to interrupted thread : 670 cycles , 5583 ns
28- Time from ISR to executing a different thread : 570 cycles , 4750 ns
29- Time to create a thread (without start) : 360 cycles , 3000 ns
30- Time to start a thread : 545 cycles , 4541 ns
31- Time to suspend a thread : 605 cycles , 5041 ns
32- Time to resume a thread : 660 cycles , 5500 ns
33- Time to abort a thread (not running) : 495 cycles , 4125 ns
34- Average semaphore signal time : 195 cycles , 1626 ns
35- Average semaphore test time : 62 cycles , 518 ns
36- Semaphore take time (context switch) : 695 cycles , 5791 ns
37- Semaphore give time (context switch) : 845 cycles , 7041 ns
38- Average time to lock a mutex : 79 cycles , 659 ns
39- Average time to unlock a mutex : 370 cycles , 3085 ns
25+ Timing results: Clock frequency: 1000 MHz
26+ Average thread context switch using yield : 9060 cycles , 9060 ns
27+ Average context switch time between threads (coop) : 9503 cycles , 9503 ns
28+ Switch from ISR back to interrupted thread : 14208 cycles , 14208 ns
29+ Time from ISR to executing a different thread : 9664 cycles , 9664 ns
30+ Time to create a thread (without start) : 3968 cycles , 3968 ns
31+ Time to start a thread : 12064 cycles , 12064 ns
32+ Time to suspend a thread : 12640 cycles , 12640 ns
33+ Time to resume a thread : 12096 cycles , 12096 ns
34+ Time to abort a thread (not running) : 2208 cycles , 2208 ns
35+ Average semaphore signal time : 8928 cycles , 8928 ns
36+ Average semaphore test time : 2048 cycles , 2048 ns
37+ Semaphore take time (context switch) : 13472 cycles , 13472 ns
38+ Semaphore give time (context switch) : 18400 cycles , 18400 ns
39+ Average time to lock a mutex : 3072 cycles , 3072 ns
40+ Average time to unlock a mutex : 9251 cycles , 9251 ns
41+ Average time for heap malloc : 13056 cycles , 13056 ns
42+ Average time for heap free : 7776 cycles , 7776 ns
4043 ===================================================================
4144 PROJECT EXECUTION SUCCESSFUL
0 commit comments