Skip to content

Commit

Permalink
Cache best match for CURI need/resolve
Browse files Browse the repository at this point in the history
Even if this doesn't result in a obvious speed increase, it has
the ability to. Consider that a lazy Distribution may eventually
end up parsing json (its slow path) to fill out the rest of its
fields (anything that isn't name/auth/ver/source/checksum) - once
this happens we may as well serve all future requests with those
fields so they don't have to do another parse.
  • Loading branch information
ugexe committed Aug 5, 2017
1 parent 07f62c6 commit bed3bbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/CompUnit/Repository/Installation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
CompUnit::DependencySpecification $spec,
--> CompUnit:D)
{
with self.candidates($spec).head {
with self!matching-dist($spec) {
return CompUnit.new(
:handle(CompUnit::Handle),
:short-name($spec.short-name),
Expand All @@ -530,7 +530,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
CompUnit::PrecompilationStore :@precomp-stores = self!precomp-stores(),
--> CompUnit:D)
{
with self.candidates($spec).head {
with self!matching-dist($spec) {
my $source-file-name = .meta<source>;
X::CompUnit::UnsatisfiedDependency.new(:specification($spec)).throw
unless $source-file-name;
Expand Down

0 comments on commit bed3bbd

Please sign in to comment.