[zeromq-dev] ZProto: why is the codec class get destroyed after each send or receive?

Doron Somech somdoron at gmail.com
Wed Jul 2 20:13:38 CEST 2014


Hi,

I noticed that the codec class in ZProto is getting destroyed after each
send or receive, this means that the object cannot be reused and a lot of
heap allocations.

I don't see any constraints with reusing the object (all the fields already
copied to the needle buffer).

I'm writing a C# codec and in C# heap allocation is more expensive than C
and happen a lot more (each byte array inside the class is another heap
allocation) and I'm thinking not to destroy the object after each send or
receive.

Regards,

Doron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140702/4cb97db1/attachment.htm>


More information about the zeromq-dev mailing list