Skip to content

Omit "duplicated" abort checks, prealloc small ints, reduce copies, share symbol table - #484

Open
xnacly wants to merge 7 commits into
d5:masterfrom
milaboratory:upstream-perf
Open

xnacly wants to merge 7 commits into
d5:masterfrom
milaboratory:upstream-perf

Conversation

@xnacly

@xnacly xnacly commented Sep 17, 2026

Copy link
Copy Markdown
  • compiler: no per-instruction maps or operand slices, dead-code
    pass and constant deduplication
  • vm: abort flag only checked on jumps and calls
  • vm: builtins use a window of op stack instead of copied slice
  • objects: Int values -128..1023 are preallocated
  • objects: map iter presize key slice

With our workload (210 scripts importing a 26k-line library set) reduce compile time from 1371ms to 791ms:

benchmark time allocs/op
Compile 39.1ms -> 19.9ms (-49%) 884k -> 275k
VM geomean (13) 13.5ms -> 12.0ms (-11%) 534k -> 218k
VM/Fib 2.46ms -> 1.78ms (-28%) 75023 -> 21
VM/Builtins 28.6ms -> 16.7ms (-42%) 1.20M -> 398k
VM/StringOps 7.94ms -> 5.92ms (-25%) 395k -> 203k
VM/ArrayIndex 18.0ms -> 14.5ms (-20%) 998k -> 400k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant