brainfuck::to_ir has incrediply poor performance on large Brainfuck programs due to its inner workings: as an AST cannot be stored in a constexpr variable. The only workaround that was found is to build constexpr lambdas that allow us to explore the AST by evaluating it completely and returning its different nodes (see brainfuck/ast_to_ir.hpp header). This makes the AST conversion way too slow, its complexity still has to be determined but I suspect it to be O(N²).
New "flat" backend was added, with much scalable performance and (subjectively) cleaner code, with compile-time benchmarks demonstrating performance superiority.
brainfuck::to_ir
has incrediply poor performance on large Brainfuck programs due to its inner workings: as an AST cannot be stored in aconstexpr
variable. The only workaround that was found is to buildconstexpr
lambdas that allow us to explore the AST by evaluating it completely and returning its different nodes (seebrainfuck/ast_to_ir.hpp
header). This makes the AST conversion way too slow, its complexity still has to be determined but I suspect it to be O(N²).