search for: refhook

Displaying 9 results from an estimated 9 matches for "refhook".

2024 Jan 12
2
Choices to remove `srcref` (and its buddies) when serializing objects
...that function serialize generates different results, functions such as `rlang::hash` and `digest::digest`, which depend on `serialize` might eventually deliver false positives on same inputs. I've checked source code in digest package hoping to get around this issue (for example serialize(..., refhook = ...)). However, my workaround did not work. It seems that the markers to the objects are different even if I used `refhook` to force srcref to be the same. I also tried `removeSource` and `rlang::zap_srcref`. None of them works directly on nested environments with multiple functions. I wonder h...
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
...gt;>> functions such as `rlang::hash` and `digest::digest`, which depend >>> on `serialize` might eventually deliver false positives on same >>> inputs. I've checked source code in digest package hoping to get >>> around this issue (for example serialize(..., refhook = ...)). >>> However, my workaround did not work. It seems that the markers to >>> the objects are different even if I used `refhook` to force srcref >>> to be the same. I also tried `removeSource` and `rlang::zap_srcref`. >>> None of them works directly on n...
2024 Jan 16
2
Choices to remove `srcref` (and its buddies) when serializing objects
...that function serialize generates different results, functions such as `rlang::hash` and `digest::digest`, which depend on `serialize` might eventually deliver false positives on same inputs. I've checked source code in digest package hoping to get around this issue (for example serialize(..., refhook = ...)). However, my workaround did not work. It seems that the markers to the objects are different even if I used `refhook` to force srcref to be the same. I also tried `removeSource` and `rlang::zap_srcref`. None of them works directly on nested environments with multiple functions. >> &g...
2012 Mar 22
1
Serializing many small objects efficiently
...e I would need to serialize according to the internal R format many small R objects I looked at the c interface void R_Serialize(SEXP s, R_outpstream_t ops); SEXP R_Unserialize(R_inpstream_t ips); If I look at the source for e.g. unserialize is see a .Call("R_unserialize", connection, refhook, PACKAGE = "base") which, despite the name of the second argument, accepts as 'connection' a raw vector. Is there any way to call that function from C -- without calling the R function? Failing that, from what I've read I gather that it is not possible to get a C stream from...
2020 Jan 29
2
Model object, when generated in a function, saves entire environment when saved
Reviving an old thread. I haven't noticed this be a problem for a while when saving RDS's which is great. However, I noticed the problem again when saving `qs` files (https://github.com/traversc/qs) which is an RDS replacement with a fast serialization / compression system. I'd like to get an idea of what change was made within R to address this issue for `saveRDS`. My thought is that
2013 Nov 16
2
serialization for external pointers
Hello, Are there any recipe to handle serialization / deserialization of external pointers. I'm thinking about something similar in spirit to the way we handle finalization of external pointers. Currently, if we create an external pointer, save the session, quit R, then load the session, we get a null pointer. One way I'm thinking of is to have an environment in the
2024 Jan 17
1
Choices to remove `srcref` (and its buddies) when serializing objects
...functions such as `rlang::hash` and `digest::digest`, which depend > >>> on `serialize` might eventually deliver false positives on same > >>> inputs. I've checked source code in digest package hoping to get > >>> around this issue (for example serialize(..., refhook = ...)). > >>> However, my workaround did not work. It seems that the markers to > >>> the objects are different even if I used `refhook` to force srcref > >>> to be the same. I also tried `removeSource` and `rlang::zap_srcref`. > >>> None of them wor...
2017 Aug 23
1
How to benchmark speed of load/readRDS correctly
Hi there Thanks for your answers. I didn't expect that this would be so complex. Honestly, I don't understand everything you wrote since I'm not an IT specialist. But I read something that reading *.rds files is faster than loading *.Rdata and I wanted to proof that for my system and R version. But thanks anyway for your time. Cheers Raphael > -----Urspr?ngliche Nachricht-----
2011 May 26
1
serialization of external pointers
Hello, I'm looking for examples of how to handle serialization of external pointers. We use external pointers intensively in Rcpp for modules and one popular request is to have persistence. And I guess we need to be able to serialize/deserialize external pointers for this. Also, module objects are all instances of reference classes, so maybe that can be handled at the R level ? Romain