[En-Nut-Discussion] Code optimization

Dusan Ferbas dferbas at etech.cz
Thu Mar 13 22:56:57 CET 2008


Hi optimizers,

what about to improve also thread switching ? I mean when events are used.

NutThreadRemoveQueue() knows thread pointer. If doubly linked list 
will be used for thread list,
then there is no need to browse the list.
With pointer to previous and to next, it can be easily removed.

If you have 4 threads, then no matter. But what if you are using e.g. 
19 threads ?

Sorry if this was discussed, but I did not find it in the Discussion archives.

Dusan

>From: Moritz Struebe <morty at gmx.net>
>Date: Thu, 13 Mar 2008 16:28:13 +0100
>...
>unfortunately the code isn't always written with performance in mind.
>Especially on the Atmels it makes a big difference whether a variable is
>8, 16 or 32 bit. Not only copying the variable is more expensive. Also
>one more register must be pushed. I've just cleaned up the event.c a bit.
>There might be more to come. I couldn't find a bug tracker otherwise I'd
>push my patches there if anyone is interested.
>
>Cheers
>Morty

Dusan 




More information about the En-Nut-Discussion mailing list