Skip to content

Commit

Permalink
fuze find+cdr as optimization for 4% performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Holodome committed Nov 25, 2023
1 parent 0e4f135 commit e1c5808
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hololisp/hll_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ hll_value hll_interpret_bytecode_internal(hll_vm *vm, hll_value env_,
goto bail;
}
hll_gc_pop_temp_root(vm->gc); // symb
// optimization: since in most cases user wants to use only cdr of symbol,
// we can fuse these two instructions
if (*current_call_frame->ip == HLL_BC_CDR) {
++current_call_frame->ip;
found = hll_unwrap_cdr(found);
}
hll_vm_stack_push(vm, found);
HLL_VM_NEXT();
}
Expand Down

0 comments on commit e1c5808

Please sign in to comment.