In a "surprise twist" that everyone with a working brain expected, it turns out shuttling variables through globals or statics is far, far more expensive than using the stack and/or registers with normal arguments and an implicit backing object. In a further upset, it turns out that Lambdas embody that pretty strongly, and the 2nd best thing is a strongly typed closure plus a thin Wide Function Pointer type.

Crazy how that works.

thephd.dev/the-cost-of-a-closu

0

If you have a fediverse account, you can quote this note from your own instance. Search https://pony.social/users/thephd/statuses/115811253468167200 on your instance and quote it. (Note that quoting is not supported in Mastodon.)