Wrote a Protobuf-like D (de)serialisation library - asking for comments / suggestions
Sinisa Susnjar
sinisa.susnjar at gmail.com
Mon Jun 14 10:10:16 UTC 2021
On Sunday, 13 June 2021 at 00:18:56 UTC, Ali Çehreli wrote:
> - If a struct contains all bitwise copyable members, instead of
> (de)serializing each member individually, the whole struct can
> by memcpy'ed. This may be a performance gain especially for
> arrays of structs: You can memcpy the whole array at once.
>
> - Instead of allocating memory for each value (e.g. for arrays
> with 'new'), you can maintain a function-static buffer and
> reuse it, allocating only as the current buffer is not large
> enough for new data. (No worries with multi-threading because
> each thread will have its own function-static buffer.)
>
> Ali
Thanks for the suggestion!
More information about the Digitalmars-d-learn
mailing list