4 ms·
I’m worried about the compile-time performance though. C++ compilers currently use direct tree-walking on the AST to interpret code, which is going to be horren
by cyber_kinetist 5y ago
I’m worried about the compile-time performance though. C++ compilers currently use direct tree-walking on the AST to interpret code, which is going to be horrendously slow once you go past a certain number of elements.
- csb6 5y agoI’m not sure what GCC and MSVC are doing, but Clang [1] at least is in the process of developing a bytecode interpreter for running constexpr code more efficiently. It seems like it hasn’t been actively worked on in quite some time, unfortunately, based on the commit logs. [1] https://clang.llvm.org/docs/ConstantInterpreter.html https://clang.llvm.org/docs/ConstantInterpreter.html