Closed SirNickolas closed 9 months ago
As I suspected, almost all metaprogramming is done with template instantiation, although many things can be moved to CTFE. The compiler is required to cache all (successful) template instantiations for every unique combination of arguments—thatʼs why -lowmem
didnʼt help.
Working on this; will send a PR as soon as I am able to run tests.
Having a mere
import argparse;
in a program and compiling it with-unittest
compiles and runs all of the argparse’s tests. Or at least attempts to. If I rundmd -lowmem -unittest -i test.d
on a file containing this single line, the compiler devours 2.8 GB of RAM; then I kill it, or else my system freezes. I have no idea how hungry it is in reality.In my opinion, inspecting some UDAs shouldn’t involve so much work. I’ll have a look at the code and see if I can figure out what is going on there.