Changes

Jump to: navigation, search

Avoiding Branches

348 bytes added, 10:50, 12 April 2020
no edit summary
=Abs, Max, Min=
It is recommend to use functions provided by the [[Languages|programming language]]. In [[C]] or [[Cpp|C++]] one should use appropriate compiler intrinsics and/or template functions provided by the [[C#Runtime|C Runtime Library]] or [[Cpp#STL|Standard Template Library]].
The tricks shown here, might be useful if compiler don't support those functions or don't generate the intended branchless assembly and the input is quite random, so that the branch prediction heuristics will fail often.
=Forum Posts=
==2000 ...==
* [https://www.stmintz.com/ccc/index.php?id=376742 branch misprediction] by [[Eric Oldre]], [[CCC]], July 14, 2004
* [https://www.stmintz.com/ccc/index.php?id=417440 Re: Fruit 2.0 Toga : Recapture extension] by [[Gerd Isenberg]], [[CCC]], March 19, 2005
==2010 ...==
* [http://www.talkchess.com/forum/viewtopic.php?p=425259#425259 Re: Function pointers hurt performance?] by [[Robert Hyatt]], [[CCC]], September 22, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=57477 Branch-poor looping] by [[Harm Geert Muller]], [[CCC]], September 02, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=57577 Mispredicted branch VS cache miss] by [[Natale Galioto]], [[CCC]], September 09, 2015
* [http://www.talkchess.com/forum/viewtopic.php?t=61423 Tipical cache and branch misses for a chess engine] by [[Nicu Ionita]], [[CCC]], September 14, 2016 » [[Memory]], [[Profiling]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72539 Misprediction-poor looping] by [[Harm Geert Muller]], [[CCC]], December 09, 2019
==2020 ...==
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73623 A Neat Trick] by [[Michael Sherwin]], [[CCC]], April 11, 2020
=External Links=
<references />
'''[[Optimization|Up one Level]]'''
[[Category:Hyatt Quotes]]
[[Category:Defunkt]]
[[Category:Joseph Bowie]]
[[Category:Kim Clarke]]

Navigation menu