[SAOC 2026] DMD CTFE Performance Weekly Update #7
Abul Hossain Khan
abulkhan19175 at gmail.com
Sun Nov 29 18:11:17 UTC 2026
Hi everyone,
This one covers the last two weeks.
#### The callback
https://github.com/dlang/dmd/pull/24365
Semantic that starts in the middle of CTFE now goes through one
function, `ctfeSemantic`. Stefan had a doubt that one parameter
is not enough to know which semantic to run, so I counted all the
calls over the test suite and some Phobos modules, and there was
not a single one where it differs.
#### The hook
https://github.com/dlang/dmd/pull/24478
This is the second step. Another engine can be plugged in through
`ctfeEngine`. It gets a top-level call and gives back the result,
or it says no and the normal interpreter runs the call. To try it
I wrote a tiny engine of my own in the test that only does
additions, and it gives a wrong sum on purpose so I can see that
it really ran. It is a proof of concept, not something to merge
like this. I think it is a good starting point.
#### Bug fixes
- https://github.com/dlang/dmd/pull/24400
- https://github.com/dlang/dmd/pull/24401
- https://github.com/dlang/dmd/pull/24444
- https://github.com/dlang/dmd/pull/24474
- https://github.com/dlang/dmd/pull/24479
- and 4 more outside CTFE
#### What's next
Dennis suggested the next step. Take the existing interpreter and
build it as a plug-in, so the same code but compiled as a
separate library and connected only through the hooks. Then see
if it gets slower because of the function pointers, and what else
shows up on the way.
Thanks to Dennis for the reviews. As always, feel free to leave
any feedback or suggestions!
More information about the Digitalmars-d
mailing list