According to this video recording of a talk from c++con, one can speed up LUA by small change in code - replacing large switch of functions with a table with goto label pointers, a generally unknown extension to c++.
https://youtu.be/IAdLwUXRUvg?t=1879 (do not let his hat distract you )
I do not know what LUA implementation is used in factorio and if rebuilding LUA from source is possible, but I thought it might be worth mentioning it here.
The factory must grow!
20 % faster lua with goto labels
Moderator: ickputzdirwech
- trad_emark
- Inserter
- Posts: 27
- Joined: Fri Sep 23, 2016 8:54 pm
- Contact:
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: 20 % faster lua with goto labels
I would be surprised if the compiler didn't already do something like that. Large switch statements are a very attractive target for this kind of automatic optimization.
Re: 20 % faster lua with goto labels
No optimization is worth such blasphemy.