Open lizmat opened 6 months ago
If this works out, then maybe all 29 ops that have a string index, should get this treatment:
$ bceval c '.map({.name if .operands.first("str")}).unique.elems'
29
Which in the core setting would mean a saving of (2 * 228568) / 11983692
= 3.8% saving.
% bceval c '.grep(*.operands.first("str")).elems'
228568
As a follow up on https://github.com/Raku/problem-solving/issues/424:
In the core c setting, the 10 most often occurring opcodes with a string index are:
It looks to me that we could get a
2 * (108459 + 61445)) / 11983692
= 2.8% reduction in frame's opcode size (and thus improve its chances of getting inlined) by creating 2 alternate versions of opcodes:dispatch_o
andconst_s
:dispatch_o_16
andconst_s_16
. The only difference with their counterparts would be reserving 2 bytes for the string index, rather than 4.In
interp.c
, the additions would be (I think, please correct me if I'm wrong, as myC
is rusty):I guess the oplist parser would need to support a new kind of string index reference, something like "str16".
And of course the necessary changes in the MAST writing.