30.07.2009, 20:25
Quote:
Originally Posted by DracoBlue
I tested (calling 1000000 times) the implementations above, without print-stuff (this would make lag, which isn't called by the function itself!) and had this results:
63 Seconds for first implementation. 18 Seconds for my implementation. |

The(other) distadvantage of putting all command logic into _one_ big function (the OnPlayerCommandText-callback) is the (always!) limited size of heap (used when you define new variables). If you don't put the command logic right into that function, but create a function for each command, it is just an extra function call, and you can put as many commands into OnPlayerCommandText without having this problem. The reason why dcmd works that way.
- Draco