Page 1 of 1

Benchmarking Stack Manipulation

Posted: Wed Jul 22, 2026 4:46 pm
by MEEPofFaith
Experiment 1: A single heavy stack manip operation.

So I was working on a hex that required performing this stack manipulation: GFEDCBA -> FECBGAD
I wanted to test how much of a lag impact this has as testing that hex usually tanks the server's tps. (Maybe I should make a forum post for that thing...)

Modpack: https://modrinth.com/modpack/hexwoven
Setup:
Image

For each test run, 8 iotas are added to the stack, then the spell imprinter loop runs the test every tick via the quad impetus setup. The spell imprinter contains a hex containing 128 copies of the test code in a row. That way, I can run the test code 128 times every tick.
Then, https://modrinth.com/mod/observable is used to profile the tps.
After waiting for the impeti to reach maximum speed, a 10 second profiler is run, then afterwards the average tick times used by all 4 impeti are added together.

Baseline Test
The spell imprinter has an empty list placed in it to test how quick the circle runs when it doesn't run anything.
  • 149 us/t
  • 134
  • 143
Test 1: Swindler's Gambit
The common choice for shuffling a bunch of iotas at once.

Code: Select all

Consideration
<901.00>
Swindler's Gambit
  • 1513 us/t
  • 1528
  • 1656
  • 1680
Test 2: Regular Stack Manipulation
Replicating the above operation using simpler stack manipulation operations.

Code: Select all

Consideration
<6.00>
Fisherman's Gambit
Jester's Gambit
Consideration
<4.00>
Fisherman's Gambit
  • 4167 us/t
  • 3572
  • 3718
  • 3874
Test 3: Geb's Gambit
Fisherman's can be swapped to Geb's Gambit from Overevaluate.

Code: Select all

Geb's Gambit: 6
Jester's Gambit
Geb's Gambit: 4
  • 3509 us/t
  • 3386
  • 3491
  • 3444
Test 4: Jumble Iota
Added by Overevaluate, a Jumble Iota reorders the stack when executed. As such, it should not be escaped.

Code: Select all

<7 [1 2 4 5 0 6 3]>
  • 506 us/t
  • 371
  • 431
  • 379
Results
Jumble Iotas are the fastest, followed by Swindler's, then Geb, then Fisherman's

Experiment 2: Basic Stack Manipulation

These tests were actually my first time using Jumble Iotas, so I decided to perform some more tests.

Test 1: Jester's Gambit
The most basic operation in existence.

Code: Select all

Jester's Gambit
  • 1620 us/t
  • 1500
Test 2: Jumble Iota
Jester's Gambit replicated by a jumble iota.

Code: Select all

<2 [1 0]>
  • 451 us/t
  • 385
Results
Once again, Jumble Iotas were faster.

Experiment 3: Lightweight Instance Tests
After the above test, @Caelum suggested repeating the above experiment with less addons installed.

New addons list:
  • Overevaluate
  • Slate Works
  • Any necessary dependencies
New setup:
Image

Baseline
  • 242 us/t
  • 199
  • 188
Test 1: Jester's Gambit
  • 570 us/t
  • 540
  • 543
Test 2: Jumble Iota
  • 484 us/t
  • 389
  • 400
Results
After cutting out a bajillion addons, Jester's Gambit now takes significantly less time, while Jumble Iota still perform similarly.

Conclusions

I believe the main contributor to lag here isn't the operation itself, but rather the search through the pattern registry. The basic Jester's Gambit test gets faster when cutting out most addons so that there's less patterns in the registry.
Jumble Iota consistently perform in similar times regardless of the number of addons because they aren't a pattern. When executed, they immediately operate without needing to run a registry match.