Merge 'Introduce instruction VTABLE' from Lâm Hoàng Phúc

this PR improves 3-6% for `prepare` benchmark without slowing down
others.  After this PR we don't have to store `InsnFunction`  in
`Program` and `ProgramBuilder` anymore, because `to_function` will
return result without matching.

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3098
This commit is contained in:
Jussi Saurio
2025-09-18 09:18:48 +03:00
committed by GitHub
5 changed files with 232 additions and 161 deletions

View File

@@ -411,7 +411,8 @@ impl CompiledExpression {
// Execute the program
let mut pc = 0usize;
while pc < program.insns.len() {
let (insn, insn_fn) = &program.insns[pc];
let (insn, _) = &program.insns[pc];
let insn_fn = insn.to_function();
state.pc = pc as u32;
// Execute the instruction