[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Microoptimization of lib/poll.c

From: Paolo Bonzini
Subject: Re: [PATCH] Microoptimization of lib/poll.c
Date: Wed, 06 Aug 2008 15:49:07 +0200
User-agent: Thunderbird (Macintosh/20080707)

3) access to thread-local errno is slow, it's also better to cache it.

Pheww! That is micro-optimization indeed.

Well, thread-local errno might involve a function call on some systems. If the function call is not CSE'd by the compiler, it means half a dozen function calls.

Do you have an objection against this further patch? Should save 2 instructions
in the case that you were not profiling.

*That* is micro-optimization! :-) It actually makes the code clearer, so go on. But I guess a division is more expensive than those 2 instructions...

(I used Shark to get the profile. rpl_poll was responsible for 6% before my optimizations and 3% afterwards. So not a big change from Amdahl's point of view :-) but a big change for this specific function).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]