mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
t/perf/benchmarks: tweak mixed arithmetic
The benchmarks which test adding an int to a num weren't measuring correctly because, after the first iteration, the PVIV var got upgraded to a PVNV - thus causing the optimised 'both args NV' path to be chosen after that. Make the benchmark recreate the integer variable on each iteration
This commit is contained in:
parent
2a920e30f9
commit
76b30116a0
@ -952,12 +952,14 @@
|
||||
},
|
||||
'expr::arith::add_lex_ni' => {
|
||||
desc => 'add an int and an NV and assign to a lexical var',
|
||||
setup => 'my ($x,$y,$z) = (1, 2.2, 3.3);',
|
||||
setup => 'my ($y,$z) = (2.2, 3.3);',
|
||||
pre => 'my $x = 1', # after 1st iter gets upgraded to PVNV
|
||||
code => '$z = $x + $y',
|
||||
},
|
||||
'expr::arith::add_pkg_ni' => {
|
||||
desc => 'add an int and an NV and assign to a package var',
|
||||
setup => 'my ($x,$y); ($x,$y,$z) = (1, 2.2, 3.3);',
|
||||
setup => 'my ($y); ($y,$z) = (2.2, 3.3);',
|
||||
pre => 'my $x = 1', # after 1st iter gets upgraded to PVNV
|
||||
code => '$z = $x + $y',
|
||||
},
|
||||
'expr::arith::add_lex_ss' => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user