A tiny JIT code generator inside cdb would definitely bring performance on par with a generated C code but it’s probably an overkill.