-
Notifications
You must be signed in to change notification settings - Fork 847
Description
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:
-
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. -
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.