Skip to content

optimizations - #207

Open
Aws0mee wants to merge 4 commits into
TeamUlysses:masterfrom
Aws0mee:patch-1
Open

optimizations#207
Aws0mee wants to merge 4 commits into
TeamUlysses:masterfrom
Aws0mee:patch-1

Conversation

@Aws0mee

@Aws0mee Aws0mee commented Sep 25, 2022

Copy link
Copy Markdown
Contributor

No description provided.

using table.IsEmpty seems to be 10% - 20% faster than checking table size
@wrefgtzweve

wrefgtzweve commented Sep 25, 2022

Copy link
Copy Markdown
Contributor

Instead of table.IsEmpty it might be better to just call next directly.
image
Also it might be great to localize these functions at the top of the file to prevent constantly having to access the global table for them.

@Aws0mee

Aws0mee commented Sep 25, 2022

Copy link
Copy Markdown
Contributor Author

Theoretically it would be slightly faster to just call next directly. However, in practice and with LuaJIT the difference is pretty much nonexistent. I figured most people would prefer to use table.IsEmpty() rather than not next() since it’s much more clear what the code is actually checking. Additionally, I don’t think many functions are localized at all so I could make another PR and localize some important ones if need be.

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