It would be nice to opt into hash environments for R6 classes. (Maybe with a new hash argument in R6Class() which forwards to new.env().)
In targets, there are few R6 objects in a given R session (so not much memory overhead) but the members of those objects are accessed frequently. In fact, targets defines several important R6 classes whose members are also R6 classes, and repeatedly digging for a nested member creates overhead. Un-nesting this structure to eliminate the overhead is not feasible for the conceptual layout and internal design of targets. crew faces similar challenges (to a lesser degree).
It would be nice to opt into hash environments for
R6classes. (Maybe with a newhashargument inR6Class()which forwards tonew.env().)In
targets, there are fewR6objects in a given R session (so not much memory overhead) but the members of those objects are accessed frequently. In fact,targetsdefines several importantR6classes whose members are alsoR6classes, and repeatedly digging for a nested member creates overhead. Un-nesting this structure to eliminate the overhead is not feasible for the conceptual layout and internal design oftargets.crewfaces similar challenges (to a lesser degree).