[En-Nut-Discussion] Code optimization

Moritz Struebe morty at gmx.net
Fri Mar 14 10:18:59 CET 2008


And adding some __atribute__ ((const)) and __attribute__ ((pure)) may 
let the compiler do quite a bit of optimization, too, because it can 
rearrange those commands.

Morty

Dusan Ferbas schrieb:
> 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 
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>   




More information about the En-Nut-Discussion mailing list