<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 28 Aug 2024 at 07:26, Walter Bright via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/26/2024 10:39 PM, Manu wrote:<br>
> Your suggestions could appear in almost every single at-least-warm function, and <br>
> it's not clear how they marry with eachother. We discussed 2 principle cases; <br>
> likely early return because of short-path or cached value, and unlikely early <br>
> return due to argument validation failure. Plenty of functions contain both <br>
> cases, and plenty of functions contain numerous such items.<br>
> Try and imagine how your suggestion scales when there are 4-5 conditions that <br>
> need to be tested on function entry, and they don't all receive the same hint. I <br>
> value readable and maintainable code...<br>
<br>
For reference, a real world example of your code?<br></blockquote><div><br></div>Here's one that I just wrote a short while ago:</div><div class="gmail_quote"></div><div class="gmail_quote"><a href="https://gist.github.com/TurkeyMan/0e49da245cc0086f852ac18deed21a9c">https://gist.github.com/TurkeyMan/0e49da245cc0086f852ac18deed21a9c</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">This function can be very hot; called once for every byte in a byte stream when sifting for a signal in a noisy transmission environment.<br></div><div class="gmail_quote">There are 4-5 guaranteed mispredictions in the nominal path in lieu of hints...<br></div></div>