Skip to content
Permalink
Browse files

Make sure intermediates are Lists

So they don't get created with containers, which saves a lot of allocations
and makes Asssociative related hyper ops about 30% faster.
  • Loading branch information...
lizmat committed Nov 11, 2018
1 parent 9221c08 commit c03e71d574e2e39f5f134e8fffb6afa0117fac0b
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/Hyper.pm6
@@ -40,7 +40,7 @@ class Hyper {

# %x >>op<< y
multi method infix(Associative:D \left, \right --> Associative:D) {
my @keys = left.keys;
my @keys is List = left.keys;
my \result := left.WHAT.new.STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
@@ -59,7 +59,7 @@ class Hyper {

# x >>op<< %y
multi method infix(\left, Associative:D \right --> Associative:D) {
my @keys = right.keys;
my @keys is List = right.keys;
my \result := right.WHAT.new.STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
@@ -278,7 +278,7 @@ class Hyper {
}

# create HLL version of keys
my @keys =
my @keys is List =
nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$keys).keys;

# run with the left/right values
@@ -306,7 +306,7 @@ class Hyper {
}

# create HLL version of keys
my @keys =
my @keys is List =
nqp::p6bindattrinvres(nqp::create(Map),Map,'$!storage',$keys).values;

# run with the left/right values

0 comments on commit c03e71d

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