[Cuis-dev] unnecessary punctuation
Mark Volkmann
r.mark.volkmann at gmail.com
Wed Jun 12 16:32:16 PDT 2024
On Wed, Jun 12, 2024 at 6:04 PM Vanessa Freudenberg via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:
> On Wed, Jun 12, 2024 at 15:32 Jaromir Matas <mail at jaromir.net> wrote:
>
>>
>> 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 #ifTrue:ifFalse
>> (hence twice as slow?).
>>
>
> In this case evaluating both arguments is pretty cheap because they’re
> simple string constants.
>
> The slowdown comes mainly from actually having to do the sends of
> “ifTrue:ifFalse:” and “value”.
>
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.
--
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240612/fb9e95d8/attachment.htm>
More information about the Cuis-dev
mailing list