From b2e8c878d18d4f1c19bd2f9ba6adccddc008eb9b Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Wed, 4 Oct 2023 03:17:24 -0500 Subject: [PATCH] :pencil: doc: failed optimization --- notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notes.md b/notes.md index 9d662fd..69cb788 100644 --- a/notes.md +++ b/notes.md @@ -64,6 +64,12 @@ Result: Regressed from 3200 to 3600. Not sure why. Plan: OP_GETFIELD hits the constants a lot. I thought caching it and not dereferencing the chunk and block constantly might help. +## Splitting up the opcode match + +Result: No change, 3200 to 3200. Maybe Rust was already optimizing this into an optimal jump table? + +Plan: Maybe if the hot inner opcodes, OP_GETFIELD, OP_MUL, and OP_SETFIELD get their own match statement at the top of the function, the step function can exit sooner. + ## Iterating over instruction list (upcoming)