Skip to content

roxygen2::roxygenize() is very slow #1720

@alexgenin

Description

@alexgenin

Hi all,

I recently updated roxygen2, and now roxygenize() takes a real while to run, while it was pretty much instant in the previous version. The slowdown appears to come from warn_missing_s3_exports(), and specifically the the methods %in% s3functions call

undocumented <- methods[!methods %in% s3functions]

I have a few datasets that are lists of matrices, which do not get filtered out from s3functions, and make the %in% call very slow.

In the same function, s3blocks is defined but never used. I suppose it was supposed to be reused in the next line.

roxygen2/R/namespace.R

Lines 399 to 400 in ace81d3

s3blocks <- blocks[map_lgl(blocks, block_has_tags, c("export", "exportS3Method"))]
s3objects <- map(blocks, function(block) block$object$value)

Changing blocks to s3blocks on line 400 fixes the slowdown on my computer.

Thanks! Hope that helps,

Alex

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