Conversation
|
Seems need to have two different altrep classes for |
|
Two classes seem fine for me. I'll review when the checks have finished. |
|
I was wondering how this even compiles with oldrel-4... Turns out we only need R >= 3.6, perhaps even R >= 3.5 would be sufficient. Can you please add verbosity, triggered by an option, so that we can test materialization? Similarly to https://github.com/duckdb/duckdb/blob/85989198104c893f302e2fff6fae6bba65156af8/tools/rpkg/src/reltoaltrep.cpp#L65-L68. |
Yes, it interesting. I have added |
|
I think we can add this option to the test which is now failing: #806 |
krlmlr
left a comment
There was a problem hiding this comment.
Thanks. As discussed, can you please extend the logging to creation and destruction of igraph objects triggered from the R code?
| if (data == R_NilValue) { | ||
| SEXP option=Rf_GetOption(Rf_install("igraph.verbose"), R_BaseEnv); | ||
| if (option != R_NilValue && !Rf_isNull(option) && LOGICAL_ELT(option, 0) == 1) { | ||
| Rprintf("Materializing 'from' vector.\n"); |
There was a problem hiding this comment.
R_ShowMessage() is slightly better here.
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
|
@Antonov548: can you please extend the logging to creation and destruction of igraph objects triggered from the R code? |
Added logs for such events of pointer: make, free, restore. Also found that rigraph already has function to make logs with option library(igraph)
igraph_options(verbose = TRUE)
g <- make_ring(3, directed = TRUE)
gs <- unserialize(serialize(g, NULL))
|
|
Thanks, great! We can work on enhancing the messages by printing which object is saved/restored, but this is good for now. options(conflicts.policy = list(warn = FALSE))
library(igraph)
igraph_options(verbose = TRUE)
g <- make_ring(3, directed = TRUE)
#> Make graph external pointer.
#> Materializing 'from' vector.
#> Materializing 'to' vector.
gs <- unserialize(serialize(g, NULL))
gs
#> Restore graph external pointer.
#> Make graph external pointer.
#> IGRAPH 7eb8913 D--- 3 3 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + edges from 7eb8913:
#> [1] 1->2 2->3 3->1Created on 2023-05-27 with reprex v2.0.2 |
from to from and to components of the R representation of an igraph objects use ALTREP to avoid unnecessary materialization
|
Thanks! |
Implement ALTREP for igraph_t_idx_from and igraph_t_idx_to (requires R 4.0)
#787