User: Password:
|
|
Subscribe / Log in / New account

likely()

likely()

Posted May 25, 2011 15:30 UTC (Wed) by SLi (subscriber, #53131)
In reply to: likely() by oak
Parent article: The problem with prefetch

I have also seen in user-space code that using the GCC equivalent of likely() in branches where I knew by profiling were much more likely to be either taken or not taken actually slows down the code. I don't quite understand the reason for this. Then in other cases it does indeed cause a speedup. When fine-tuning performance I have had to try it branch by branch to get the best results, and even then I'm not sure it generalizes to other processor models.


(Log in to post comments)

likely()

Posted May 30, 2011 15:21 UTC (Mon) by berkus (guest, #74327) [Link]

-fprofile-arcs first!

likely()

Posted Jun 1, 2011 4:20 UTC (Wed) by AdamRichter (guest, #11129) [Link]

Sometimes you want to minimize latency for the less commonly used but more important branch, such as in almost any polling loop.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds