Skip to content

Instantly share code, notes, and snippets.

@kartben
Last active November 30, 2023 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartben/c59e9e0b4e89f784b3ecd3cde92c21ae to your computer and use it in GitHub Desktop.
Save kartben/c59e9e0b4e89f784b3ecd3cde92c21ae to your computer and use it in GitHub Desktop.
Zephyr latency_measures
M5Stack AtomS3 @240MHz
*** Booting Zephyr OS build zephyr-v3.5.0-2395-gc8f4455ef8f9 ***
Preemptive threads ctx switch via k_yield (K -> K) : 579 cycles , 2412 ns :
Cooperative threads ctx switch via k_yield (K -> K) : 568 cycles , 2370 ns :
Switch from ISR back to interrupted thread : 148 cycles , 620 ns :
Switch from ISR to another thread (kernel) : 304 cycles , 1270 ns :
Create kernel thread from kernel thread : 215 cycles , 896 ns :
Start kernel thread from kernel thread : 573 cycles , 2391 ns :
Suspend kernel thread from kernel thread : 681 cycles , 2841 ns :
Resume kernel thread from kernel thread : 636 cycles , 2654 ns :
Abort kernel thread from kernel thread : 205 cycles , 858 ns :
Give a semaphore (no waiters) from kernel thread : 67 cycles , 279 ns :
Take a semaphore (no blocking) from kernel thread : 41 cycles , 171 ns :
Take a semaphore (context switch K -> K) : 727 cycles , 3029 ns :
Give a semaphore (context switch K -> K) : 786 cycles , 3279 ns :
Lock a mutex from kernel thread : 44 cycles , 187 ns :
Unlock a mutex from kernel thread : 15 cycles , 66 ns :
Average time for heap malloc : 819 cycles , 3416 ns :
Average time for heap free : 709 cycles , 2957 ns :
===================================================================
PROJECT EXECUTION SUCCESSFUL
*****
STM32 F746G Disco @216 MHz
*** Booting Zephyr OS build zephyr-v3.5.0-2347-g76791cd70827 ***
Preemptive threads ctx switch via k_yield (K -> K) : 318 cycles , 1474 ns :
Cooperative threads ctx switch via k_yield (K -> K) : 325 cycles , 1507 ns :
Switch from ISR back to interrupted thread : 419 cycles , 1943 ns :
Switch from ISR to another thread (kernel) : 461 cycles , 2136 ns :
Create kernel thread from kernel thread : 354 cycles , 1643 ns :
Start kernel thread from kernel thread : 465 cycles , 2155 ns :
Suspend kernel thread from kernel thread : 439 cycles , 2034 ns :
Resume kernel thread from kernel thread : 379 cycles , 1756 ns :
Abort kernel thread from kernel thread : 304 cycles , 1408 ns :
Give a semaphore (no waiters) from kernel thread : 105 cycles , 486 ns :
Take a semaphore (no blocking) from kernel thread : 59 cycles , 273 ns :
Take a semaphore (context switch K -> K) : 503 cycles , 2332 ns :
Give a semaphore (context switch K -> K) : 605 cycles , 2802 ns :
Lock a mutex from kernel thread : 64 cycles , 296 ns :
Unlock a mutex from kernel thread : 22 cycles , 101 ns :
Average time for heap malloc : 429 cycles , 1988 ns :
Average time for heap free : 320 cycles , 1482 ns :
===================================================================
PROJECT EXECUTION SUCCESSFUL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment