Large Size of R packages containing S4 classes
1
1
Entering edit mode
@lukaszbednarz-16985
Last seen 3.1 years ago

I have noticed that if using very complex s4 inheritance R is storing all current class metadata in given package together with all virtual classes that might be defined in another packages and respective "SClassExtension" objects for all classes existing in hierarchy (wheather they are needed in current context).

All meta data is stored in .rdb file weather given classes are imported or not.

This way as the depth of inheritance is increasing and more complex objects are built via extension or containment the packages are becoming bigger and bigger.

The end result is that the packages take more time to build and grow in size.

Any Idea how this behaviour can be prevented?

For example I have some "myBaseVirtualClass" implementing basic slots and methods.

There might be another 100s of other packages iheriting from  "myBaseVirtualClass" at the distance up to 10  and all these will be stored in the package metadata. Why?

Thanks for any help 

S4 packages • 416 views
ADD COMMENT
1
Entering edit mode
@michael-lawrence-3846
Last seen 6 weeks ago
United States

Is this problem more than just theoretical? Do you have a case where this really matters?

Build and load time for sure is dominated by things other than metadata (de)serialization.

ADD COMMENT

Login before adding your answer.

Traffic: 221 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6