Skip to content

Rcpp Modules namespace-load cost #1514

Description

@Enchufa2

Reported initially in rspatial/terra/issues/1440: terra (especially, but also other packages using modules) takes a lot of time to load. @mdsumner did an analysis and found this:

  1. Methods are analyzed twice, because the initialize method is added after class creation, which triggers another full pass.
  2. Modules use reference classes. Using S4 in this context is much cheaper.

Full report and patches here. The patch for (1) doesn't change the behavior and is short and clear. The patch for (2) requires full revdep checks, but I wouldn't expect issues unless some package relies on modules being reference classes, which shouldn't. @mdsumner Would you mind sending the patches as PRs?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions