[zeromq-dev] ZProto: why is the codec class get destroyed after each send or receive?
Pieter Hintjens
ph at imatix.com
Wed Jul 2 20:50:31 CEST 2014
You can of course implement any code you like from the abstract model.
The one we use in C is based on the CZMQ style. I know it's not very
efficient, way too many memory allocations. The idea is, make it work,
then make it better.
On Wed, Jul 2, 2014 at 8:13 PM, Doron Somech <somdoron at gmail.com> wrote:
> 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
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list