Skip to content
Permalink
Browse files

Cache best match for CURI need/resolve

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 bed3bbd08c298e25c2b3eed0aeef55664832b8c2
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/CompUnit/Repository/Installation.pm
@@ -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),
@@ -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;

0 comments on commit bed3bbd

Please sign in to comment.
You can’t perform that action at this time.