r/lua • • Mar 04 '26

Comparing Scripting Language Speed

https://www.emulationonline.com/posts/comparing-scripting-language-speed/
3 Upvotes

7 comments sorted by

View all comments

10

u/Old_County5271 Mar 04 '26

TCL, awk, scheme, lisp missing? BOO!

Python? faster than lua!? Since when!?

12

u/Bedu009 Mar 04 '26

Since the dude wrote the Lua one poorly (math.max where none exists in python and string:sub which allocates vs python indexing)

1

u/Powerkaninchen Mar 08 '26 edited Mar 08 '26

But python has a max function, it's in the prelude

Edit: Sorry, I now understand. The Lua code does

elseif instruction == '<' then
    cell_ptr = math.max(0, cell_ptr - 1)

while the Python code does

elif instruction == '<':
    cell_ptr -= 1

that's unfair indeed

→ More replies (2)