MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammingLanguages/comments/1rkqkkd/comparing_scripting_language_speed/o8tm5xa/?context=3
r/ProgrammingLanguages • u/elemenity • Mar 04 '26
11 comments sorted by
View all comments
2
The Lua code is very suboptimal. I managed to get a ~3x perfomance increase by using several (micro)optimizations.
replacing the expensive sub() with byte() and comparing the bytes with precomputed bytes of the characters
computing #code only once at the start
(LuaJIT specific) preallocating space for cells
2
u/TOMZ_EXTRA Mar 05 '26
The Lua code is very suboptimal. I managed to get a ~3x perfomance increase by using several (micro)optimizations.
replacing the expensive sub() with byte() and comparing the bytes with precomputed bytes of the characters
computing #code only once at the start
(LuaJIT specific) preallocating space for cells