Forcing inlining of delegates and lazy
FinalEvilution
FinalEvilution at gmail.com
Wed Sep 2 03:26:26 UTC 2026
On Wednesday, 2 September 2026 at 01:11:12 UTC, ABrightLight
wrote:
> It looks like you're right.
> `main` ends up with 3 calls to `foo` in the first example and
> then another 3 calls to `foo` as part of the second test, even
> thought the `times` and `timesAgain` functions remain in the
> binary and have different instructions.
>
> I'll go ahead and rely on this in hotcode. Thanks for your help!
Your welcome!
I find these small optimization problems to be good knowledge
exercises for myself.
For example i didn't know that each freestanding `writeln` would
turn into 3 function calls, even when in sequence. The more you
know.
https://godbolt.org/z/nPrav4331
If you get stumped on anything else feel free to ask on the Learn
forum.
If it's in an area i, or someone else know, we may be able to
help.
More information about the Digitalmars-d
mailing list