Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(compile): remove table overhead for better performance #410

Merged
merged 1 commit into from Feb 17, 2023
Merged

Conversation

nullchilly
Copy link
Member

@nullchilly nullchilly commented Feb 17, 2023

Problem: { string.byte } is only faster if we re-use the table a lot

Solution: Remove table caching

The definition for pairs is function pairs(t) return next, t, nil end so we have another small optimization to use next, t instead of pairs(t)

Benchmark was done on both the main and perf branch:

branch time (ms)
main 0.3883049273
perf 0.0047219172

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.

None yet

2 participants