Replies: 12 comments 1 reply
-
I'm copying @traversc as we need to have a joined-up discussion here. The only meaningful integration I can see is at the C level with nanonext, if qs2 can be used as a drop-in replacement for R serialization. @traversc, for qs2 do you plan / consider to expose functions with the following signatures (or equivalent) by registering them as C callables? void qs2_serialize(unsigned char *, size_t *, SEXP);
SEXP qs2_unserialize(unsigned char *, size_t); For serialization, I'm thinking it could be 2-pass, where passing NULL will return the size required. But you might do all the memory management in-package so I won't pre-suppose anything. It should be fairly straightforward to wrap your C++ functions with an |
Beta Was this translation helpful? Give feedback.
-
A two pass would be pretty inefficient. If it was C++ returning a
|
Beta Was this translation helpful? Give feedback.
-
Yeah the 2-pass is a kind of C way of thinking of things. I think you should just do the serialization and store it in whatever C++ object or class. Then have an Just wanted to check conceptually you plan it to be a drop-in for R serialization? |
Beta Was this translation helpful? Give feedback.
-
Yes, it should be a drop in replacement since I'm using Question for you, do you see a use for in-memory compression? Or is the data generally small enough that it doesn't matter? We can get on average ~8x compression with a some overhead, but that can be tuned based on zstd compression level. |
Beta Was this translation helpful? Give feedback.
-
From my end, in-memory compression would be extremely valuable, and it's the reason why I am interested in this thread and qsbase/qs2#4 |
Beta Was this translation helpful? Give feedback.
-
Can you have a look at the latest commit and example here? qsbase/qs2#4 |
Beta Was this translation helpful? Give feedback.
-
I haven't been able to run it yet, but it looks promising! Sorry I was not totally up to date - I thought qs2 was still an early stage proof of concept, didn't realise it had already reached CRAN. Will let you know once I've tested. As for compression, yes it would be useful as creating the serialised object (buffer) necessarily creates a copy. So I think this would be useful even on the same machine. But regardless, minimising bytes transferred over the wire makes sense in a networked scenario e.g. HPC cluster. |
Beta Was this translation helpful? Give feedback.
-
@shikokuchuo Have you had a chance to check it out? I am hoping to submit a CRAN update soon. |
Beta Was this translation helpful? Give feedback.
-
Hi Travers, sorry I didn't get the chance today. I'll see if I have time over the weekend, otherwise please go ahead if you don't hear from me by Monday. |
Beta Was this translation helpful? Give feedback.
-
Once the functionality is merged in |
Beta Was this translation helpful? Give feedback.
-
Just to update on this, I need to have a re-think of where this functionality naturally sits (long-term in R). I've been introduced to the |
Beta Was this translation helpful? Give feedback.
-
The best place for these functionality would be in base R ;) But given that is unlikely any time soon, I think it will be difficult (logistically and technically) to merge all possible functionality into a single comprehensive package. Briefly looking over the For the |
Beta Was this translation helpful? Give feedback.
-
As we have discussed,
crew
cannot set a serialization method throughmirai
because the mechanism relies oneverywhere()
. As a compromise, would it be okay to have the option to disable built-in serialization and leave it to the user? That would allowcrew
to leverage the compression capabilities ofqs::qserialize()
/qs::qdeserialize()
without incurring duplicate overhead from serializing twice.Beta Was this translation helpful? Give feedback.
All reactions