[Swan-dev] wicked waste of CPU
D. Hugh Redelmeier
hugh at mimosa.com
Fri Mar 21 07:57:22 EET 2014
| From: D. Hugh Redelmeier <hugh at mimosa.com>
| These commands server no useful purpose and waste a fair bit of time.
| reply_buffer is 64k long. One of these is executed for every output
| packet.
I was wrong, but only because of a bug.
#define zero(x) memset((x), '\0', sizeof(*(x))) /* zero all bytes */
zero(array) only zeros the first element. zero(&array) is correct.
I've fixed all the calls to zero that were wrong. Most were these
zero(reply_buffer) calls. There was one other.
So NOW all these calls waste CPU. Before, they were ineffective.
More information about the Swan-dev
mailing list