Page 1 of 1

how much time is too much?

Posted: 14 Feb 2013, 20:29
by Originway
just what kind of timings are we supposed to be shooting for with javascript?
is there a good reference that we can check to make sure we don't slow the game down too much?
I saw this post
vexed wrote:Anything above 5ms is way too much. (heck, I would think anything above 3ms, but I am not sure what kind of overhead we have with the script stuff right now.)

While it may not seem like much, once you start adding in more AIs, then that 5ms can quickly climb to 45ms for 9 AI players.

I also think that if a function really is that slow, it would be much better to have support on the C++ side, but it should be a widely used function, and not something specific to the AI in question.
and he says 5 ms is too high? is that correct? how do you quickly calculate that with the max number of units for each player?

Re: how much time is too much?

Posted: 14 Feb 2013, 21:22
by aubergine
Use the performance log to see how long your script is taking to do things.

Find the event handlers that are slowest and find ways to speed them up.

Using some caching and other tricks you can greatly improve performance, take a look at NullBot 3 for examples.

Re: how much time is too much?

Posted: 15 Feb 2013, 10:26
by Duha
aubergine wrote:Use the performance log to see how long your script is taking to do things.

Find the event handlers that are slowest and find ways to speed them up.

Using some caching and other tricks you can greatly improve performance, take a look at NullBot 3 for examples.
Slow, fast, 5ms, 10ms. All depends of you computer :)