Skip to content

Optimize OutputIterator using a queue structure - #3725

Merged
Astralcircle merged 3 commits into
wiremod:masterfrom
n1lordduck:perf/output-iterator-fifo
Sep 21, 2026
Merged

Astralcircle merged 3 commits into
wiremod:masterfrom
n1lordduck:perf/output-iterator-fifo

Conversation

@n1lordduck

Copy link
Copy Markdown
Contributor

Replaced table.insert and table.remove(self, 1) with a queue implementation using explicit first and last pointers, because shifting elements out of a table with table.remove(1) triggers a re-indexing every iteration

I've taken inspiration from here: https://www.lua.org/pil/11.4.html

I've tested implementing this with the following code: gist

Results:
image

Ignore the push/pop score, i've been making an addon with my own personal wiremod preferences (hence why the gist code looks like that) but i think this change would benefit wiremod

@Astralcircle
Astralcircle merged commit f31ba74 into wiremod:master Sep 21, 2026
1 check passed
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