Skip to content
Permalink
Browse files

Use the new STORE(\keys,\values) for metaops

This makes %h >>+<< %h about 8x as fast for a 26 key hash.
  • Loading branch information...
lizmat committed Nov 14, 2018
1 parent 534d8f6 commit 7fad12b0ee069a71253c0f45f83b497638c089f4
Showing with 12 additions and 24 deletions.
  1. +12 −24 src/core/Hyper.pm6
@@ -50,12 +50,9 @@ class Hyper {

my @keys is List = left.keys;
my \result := nqp::create(left.WHAT).STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
(@keys, self.infix(left{@keys}, right))
)
),
:INITIALIZE
@keys,
self.infix(left{@keys},right),
:INITIALIZE
);
nqp::iscont(left) ?? result.item !! result;
}
@@ -72,12 +69,9 @@ class Hyper {

my @keys is List = right.keys;
my \result := nqp::create(right.WHAT).STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
(@keys, self.infix(left, right{@keys}))
)
),
:INITIALIZE
@keys,
self.infix(left,right{@keys}),
:INITIALIZE
);
nqp::iscont(right) ?? result.item !! result;
}
@@ -339,12 +333,9 @@ class Hyper {

# run with the left/right values
my \result := nqp::create(left.WHAT).STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
(@keys, quietly self.infix(left{@keys}, right{@keys}))
)
),
:INITIALIZE
@keys,
(quietly self.infix(left{@keys}, right{@keys})),
:INITIALIZE
);
nqp::iscont(left) ?? result.item !! result;
}
@@ -368,12 +359,9 @@ class Hyper {

# run with the left/right values
my \result := nqp::create(left.WHAT).STORE(
Seq.new(
Rakudo::Iterator.RoundrobinIterablesFlat(
(@keys, quietly self.infix(left{@keys}, right{@keys}))
)
),
:INITIALIZE
@keys,
(quietly self.infix(left{@keys}, right{@keys})),
:INITIALIZE
);
nqp::iscont(left) ?? result.item !! result;
}

0 comments on commit 7fad12b

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