Skip to content

Avoid unnecessarily loading the hackage index #1892

@mgsloan

Description

@mgsloan

Loading the hackage is expensive, because the encoded index cache is 18Mb. On my fairly fast computer, it takes 0.3 seconds to decode it. Search getPackageCaches to find the spots it's used.

There are two cases where loading the hackage currently happens unnecessarily:

  1. In loadSourceMap, because the user might have specified a package target on the commandline which is not in the resolver. In this case, it uses the latest from hackage.

  2. In constructPlan, because plan construction errors get annotated with "latest applicable" versions.

For both of these, loading the hackage index is only necessary under specific and abormal circumstances. However, currently this expensive operation is being done regardless of need.

It's also used in resolveBuildPlan, but that only seems to be used by the tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions