[Swan-dev] wicked waste of CPU

Paul Wouters paul at nohats.ca
Fri Mar 21 20:07:46 EET 2014


On Fri, 21 Mar 2014, D. Hugh Redelmeier wrote:

> It should not take much work to make reply_buffer file-static in
> packet.c.  Would that make my assertion more convincing?
>
> The only code that should write to it is marshalling code, and that is
> supposed to be manifestly well-behaved.
>
> Still, uninitialized stuff might be copied in by the marshalling code
> and then sent out on the wire.  But this is unrelated to zeroing
> reply_buffer.

I really would like the precaution in there, but if possible just as
part of init_pbs(). As we pass reply_buffer and sizeof(reply_buffer)
that should be easy to move into init_pbs()

> | We could make the 64k smaller. I don't think things ever get even
> | remotely near to that maximum.
>
> What number could you justify?

I don't know. Even 32kb seems excessive, but I have no good way of
judging what things will creep up to. The biggest unknown would be
a certificate payload with issuers in it as well.

Paul


More information about the Swan-dev mailing list