Context Switch time and GCC performance options

Currently I am working on the optimization options of my project. I am evaluating the impact of the CGG optimizations on a very significant performance parameter of a RTOS, the Context Switch time.

The context switch time is measured by working with 2 threads, one client and a server, the client sends a message to the server, the server increases the message value and sends the result back to the client, the operation involves 2 context switches and is repeated during one second time (the source is in the project).

Playing with the various options I saw that the settings can improve the kernel performance really much, the context switch time can go from 6.42μS down to 3.37μS depending on the various compiler/kernel options, the space/time trade offs are very interesting.

The results of my research are presented in this spreadsheet:

http://www.mechlab.net/files/Performance.ods

I hope you will find it useful.

Good work :slight_smile:

I think it will help people choosing the right optimization level.