10.02.2009, 03:32
Quote:
|
Originally Posted by backwardsman97
Why did you make the variable named "string" with a size of 256?
Quote:
|
Quote:
|
Originally Posted by Kye
I have decided to unsticky this topic because it was shown in an earlier benchmark that the performance difference between allocating 128 vs 256 cells was negligible. String allocation is unlikely to occur during any tight loops where most performance issues exist.
It's true that the chat/window buffer length is a maximum of 128, however it's dangerous in many languages to allocate buffers smaller or equal to the size of the original string. 256 is generally used to give 128 base length plus an additional 128 characters if anything further is appended. It should be noted that anything sent to the client intended for the chat window that is greater than 128 characters will be ignored. Program optimisation has been studied since the 1960s and they have found that most execution time and bottlenecks occur in the inner-most loop. |

