Skip to content

Comparative measures between FIFO and HEAP

paeolo edited this page Feb 5, 2018 · 6 revisions

Measures of time taken by Trampoline Services

Time is measured with a scope between two GPIO output changes.

  • Target: STM32F4 Discovery board from ST, STM32F407VG running at 168MHz
  • Compiler: GCC 4.9.3
  • Optimization: -O3
  • Scope: RIGOL MSO1104Z 100MHz 4 channels oscilloscope.

Comparison between HEAP/FIFO implementations of the ready list

StartOS

From StartOS to AUTOSTART task: A GPIO output is switched on just before StartOS, A second GPIO output is switched on at start of the AUTOSTART task

  • HEAP: 5.80µs
  • FIFO/HEAP: 5.76µs
  • FIFO: 5.48µs

StartOS - with 10 Tasks

Similar to the previous one but with 10 auto-start Tasks with lower priority than the AUTOSTART Task.

  • HEAP: 13.44µs
  • FIFO/HEAP: 10.76µs
  • FIFO: 9.52µs

ActivateTask

Lower or equal priority task

An autostart task activates a lower or equal priority task. No preemption occurs. A GPIO output is switched on just before ActivateTask, A second GPIO output is switched on just after ActivateTask.

  • HEAP: 2.70µs
  • FIFO/HEAP: 2.52µs
  • FIFO: 2.40µs

Greater priority task

An autostart task activates a higher priority task. A preemption occurs. A GPIO output is switched on just before ActivateTask, A second GPIO output is switched on at start of the activated task.

  • HEAP: 5.04µs
  • FIFO/HEAP: 4.78µs
  • FIFO: 4.30µs

SetEvent

Non waiting task

A higher priority AUTOSTART task sets an event to a lower priority AUTOSTART extended task. the extended task is READY but has not yet run, so it is not waiting for an event. A GPIO output is switched on just before SetEvent, A second GPIO output is switched on just after SetEvent.

  • HEAP: 1.76µs
  • FIFO/HEAP: 1.73µs
  • FIFO: 1.68µs

Waiting lower priority task

A higher priority task sets an event to a lower priority extended task. the extended task is WAITING. No preemption occurs. A GPIO output is switched on just before SetEvent, A second GPIO output is switched on just after SetEvent.

  • HEAP: 2.88µs
  • FIFO/HEAP: 2.84µs
  • FIFO: 2.60µs

Waiting higher priority task

A lower priority task sets an event to a higher priority extended task. the extended task is WAITING. A preemption occurs. A GPIO output is switched on just before SetEvent, A second GPIO output is switched on juste after the WaitEvent.

  • HEAP: 4.60µs
  • FIFO/HEAP: 4.68µs
  • FIFO: 4.02µs