Open atoomic opened 4 years ago
Some questions:
//= 1
Literally this just that, or //= ANYCONSTANT
EXPR ? 1 : 0 and !!EXPR 1 - !EXPR
What are some common examples of this in the wild? Are these definitely hot patterns?
Note: Devel::GoFaster looks to optimize my $x = shift
and my $x = shift // INT
. I've started looking into a core optimization that could handle all of these:
my $x = shift
my $x = shift // ANYCONSTANT
my $x = shift || ANYCONSTANT
my $x = shift // ANON_HASH_OR_ARRAY
my $x = shift || ANON_HASH_OR_ARRAY
Why exclude CODE
and GLOB
. I think I used and use all variants of my $x = shift // Any;
I think I used and use all variants of
my $x = shift // Any;
Yeah. I was thinking about known-simple and common op structures that could be reduced to 1 or two ops, but could make it jump to arbitrary Any
trees as well.
Devel::GoFaster provide a prototype to optimize the optree for some common patterns
@arc was also suggesting in https://github.com/p5h/p5summit-2019/issues/18 to consider