Post edit history
Programming - Optimization?
Before | After | ||
---|---|---|---|
1 | GoogleFrog: | 1 | GoogleFrog: |
2 | From a testing I did some time ago creating lua tables is also very expensive ( takes 60x more time compared to a typical lua instruction) and should be avoided where possible, in many cases you can reuse tables etc. | 2 | From a testing I did some time ago creating lua tables is also very expensive ( takes 60x more time compared to a typical lua instruction) and should be avoided where possible, in many cases you can reuse tables or just avoid creating empty tables that are not going to get used. |
3 | \n | 3 | \n |
4 | For example GiveOrderXYZ functions accept number instead of options table, so you can use 0 instead of {}. This also avoids table parsing on the engine side. | 4 | For example GiveOrderXYZ functions accept number instead of options table, so you can use 0 instead of {}. This also avoids table parsing on the engine side. |