August 03, 2015 Re: Cerealed v0.6.1: even less boilerplate for binary serialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Monday, 3 August 2015 at 12:21:05 UTC, Per Nordlöw wrote: > On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote: >> Yes. `cerealise` and `decerealise`. The former is slightly weird for performance reasons. It takes a lambda that tells it what to do with the resulting bytes. >> >> Close with LDC and DMD, faster with GDC: http://forum.dlang.org/post/nkcelouzpjsgmqtvnonq@forum.dlang.org > > Nice! > > Are there any plans to add different backends (for instance msgpack) to Cereal? Then we could have one package to rule them all! I've thought about that (and even JSON or XML) but I'm not 100% convinced that it would work with the existing, and more importantly to me, not high on my list of priorities. I'm definitely not opposed to it. > > I'll try Cereal in favor of msgpack next time! > > Thanks, Atila! Glad to be useful. :) Atila |
August 03, 2015 Re: Cerealed v0.6.1: even less boilerplate for binary serialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Monday, 3 August 2015 at 12:21:05 UTC, Per Nordlöw wrote: > On Monday, 3 August 2015 at 11:51:24 UTC, Atila Neves wrote: >> Yes. `cerealise` and `decerealise`. The former is slightly weird for performance reasons. It takes a lambda that tells it what to do with the resulting bytes. >> >> Close with LDC and DMD, faster with GDC: http://forum.dlang.org/post/nkcelouzpjsgmqtvnonq@forum.dlang.org > > Nice! > > Are there any plans to add different backends (for instance msgpack) to Cereal? Then we could have one package to rule them all! > > I'll try Cereal in favor of msgpack next time! > > Thanks, Atila! As I tried the changes on the same test as in [0] It went on my PC like this: DMD debug: Cerealed: 2 secs, 854 ms, 687 μs, and 2 hnsecs MsgPack: 2 secs, 328 ms, 698 μs, and 3 hnsecs DMD release: Cerealed: 1 sec, 619 ms, 570 μs, and 9 hnsecs MsgPack: 1 sec, 554 ms, and 185 μs LDC2 release: Cerealed: 966 ms, 398 μs, and 4 hnsecs MsgPack: 926 ms, 792 μs, and 3 hnsecs GDC release: Cerealed: 1 sec, 97 ms, 892 μs, and 1 hnsec MsgPack: 1 sec, 138 ms, 359 μs, and 2 hnsecs So it's almost the same now. [0] http://forum.dlang.org/post/nkcelouzpjsgmqtvnonq@forum.dlang.org |
August 03, 2015 Re: Cerealed v0.6.1: even less boilerplate for binary serialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On 03/08/15 14:21, Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow@gmail.com> wrote: > Are there any plans to add different backends (for instance msgpack) to > Cereal? Then we could have one package to rule them all! That would be Orange [1]. Hopefully I'll get it into Phobos at some point. [1] https://github.com/jacob-carlborg/orange -- /Jacob Carlborg |
August 03, 2015 Re: Cerealed v0.6.1: even less boilerplate for binary serialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On Monday, 3 August 2015 at 09:40:59 UTC, Atila Neves wrote:
> In this case, yes. In the real-life case I was simplifying, it wasn't a ubyte[] array, it was an array of structs with non-trivial serialisation that also depended on a previous deserialised variable. It was more like this:
>
> struct Outer {
> static struct Header { ... }
> Header header;
> @LengthInBytes("length - headerSize") Inner[] array;
> }
>
> struct Inner {
> static struct Header { ... }
> Header header;
> @ArrayLength("length") Unit[] units; //actual length of the array instead of in bytes
> }
>
> struct Unit { ... }
>
> So maybe not as useless after all ;)
>
> Atila
Thanks. Very nice indeed.
|
August 04, 2015 Re: Cerealed v0.6.1: even less boilerplate for binary serialization | ||||
---|---|---|---|---|
| ||||
Posted in reply to Atila Neves | On 8/3/2015 4:46 AM, Atila Neves wrote:
> On Monday, 3 August 2015 at 11:13:50 UTC, Walter Bright wrote:
>> On 8/3/2015 2:21 AM, Atila Neves wrote:
>>> [...]
>>
>> Please put this as the first comment on the reddit post.
>
> Which one?
The one you started the thread with.
On a more meta note, when people look at a discussion on reddit and see zero comments, they move on. Having a comment there saying briefly what the link is about and why the reader might be interested in it is far more effective at getting readers to spend some time reading your article.
It also gives you an opportunity to shape the discussion in a direction you'd like. If some troll makes the first post, it sets a trollish tone and can completely ruin all the effort you put into the article.
Don't leave things to chance!
|
Copyright © 1999-2021 by the D Language Foundation