<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2024 at 6:04 PM Vanessa Freudenberg via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div><div>On Wed, Jun 12, 2024 at 15:32 Jaromir Matas <<a href="mailto:mail@jaromir.net" target="_blank">mail@jaromir.net</a>> wrote:<br></div></div><div><div><div class="gmail_quote"></div></div></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div><div><br></div>
<div style="clear:both">So if I understand correctly the #ifTrue:ifFalse message gets inlined only when used with block arguments, and it gets really sent when used without blocks; which means not only there's one more send but also that **both** 'Yes' and 'No' expressions get evaluated before sending <span style="border-color:rgb(255,255,255)">#ifTrue:ifFalse (hence twice as slow?).</span></div></div></blockquote><div dir="auto"><br></div></div></div><div><div><div dir="auto">In this case evaluating both arguments is pretty cheap because they’re simple string constants. </div><div dir="auto"><br></div><div dir="auto">The slowdown comes mainly from actually having to do the sends of “ifTrue:ifFalse:” and “value”. </div></div></div></blockquote><div><br></div><div>Doesn't it seem like the compiler could also be optimized to recognize when the values passed are literal values and then perform the same optimization it does for blocks? I understand it doesn't do that currently and so it is more efficient to pass blocks.</div><div> </div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>