Skip to content

PackageBuilder should be short-lived #3007

Open
@srawlins

Description

@srawlins

PackageBuilder does a lot of work to set up a PackageGraph, using analyzer's ContextCollection, which holds onto lots of stuff for all of the analyzed code. A PackageBuilder is an instance field on the Dartdoc class, but is used in exactly one place: Dartdoc.generateDocsBase, to generate the PackageGraph.

I worry that Dartdoc's PackageBuilder is not being GC'd. In any case, the API feels unclean, that it holds onto this object for one task at the beginning of doc generation. It would be better if Dartdoc.generateDocsBase instantiated the PackageBuilder. Alternatively, PackageBuilder.buildPackageGraph could create a local ContextCollection, but I think that defeats a lot of the benefit of having a separate class for building a PackageGraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work ontype-performanceIssues related to slow dartdoc generation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions