Skip to content

Adding step_time and iteration to CycleMapContext#113

Merged
emuell merged 2 commits intodevfrom
cycle-step_time
Apr 30, 2026
Merged

Adding step_time and iteration to CycleMapContext#113
emuell merged 2 commits intodevfrom
cycle-step_time

Conversation

@unlessgames
Copy link
Copy Markdown
Collaborator

Implementing #81 as discussed, while also adding the iteration counter to the map context as it's useful there as well.

I've included a helper to make the code a bit more streamlined around setting stuff on lua callbacks across the codebase while handling the error. This can be reverted of course if the more verbose way is preferred.

Note, src/gate/scripted.rs called reset on the callback twice, I assume that was a copy-paste typo.

@github-actions
Copy link
Copy Markdown

Benchmark for 5d79cc6

Click to view benchmark
Test Base PR %
Cycle/Generate 50.9±0.82µs 51.6±0.43µs +1.38%
Cycle/Parse 310.0±4.17µs 319.2±4.27µs +2.97%
Rust Phrase/Clone 421.4±4.61ns 448.1±5.11ns +6.34%
Rust Phrase/Create 64.9±0.89µs 66.9±0.74µs +3.08%
Rust Phrase/Run 607.9±5.71µs 621.7±4.92µs +2.27%
Rust Phrase/Seek 131.7±242.41µs 134.2±248.33µs +1.90%
Scripted Phrase/Clone 642.0±16.74ns 647.0±6.23ns +0.78%
Scripted Phrase/Create 1007.8±28.33µs 1001.6±22.49µs -0.62%
Scripted Phrase/Run 1653.1±11.62µs 1626.0±18.48µs -1.64%
Scripted Phrase/Seek 217.8±440.94µs 205.4±410.94µs -5.69%

@emuell
Copy link
Copy Markdown
Member

emuell commented Apr 30, 2026

Looks good. Thanks. The handle thing is nice as well to get rid of all this error boilerplate.

@emuell emuell merged commit ce9156e into dev Apr 30, 2026
2 checks passed
@emuell emuell deleted the cycle-step_time branch April 30, 2026 21:14
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.

2 participants