Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed regression when pushing a range to an array #3491

Closed
p6rt opened this issue Aug 28, 2014 · 5 comments
Closed

speed regression when pushing a range to an array #3491

p6rt opened this issue Aug 28, 2014 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Aug 28, 2014

Migrated from rt.perl.org#122641 (status was 'resolved')

Searchable as RT122641$

@p6rt
Copy link
Author

p6rt commented Aug 28, 2014

From @FROGGS

FROGGS star-m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1...20)}; say now - $now;
camelia star-m 2014.04​: OUTPUT«7.7825408␤»
FROGGS star-m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1...20)}; say now - $now;
camelia star-m 2014.04​: OUTPUT«7.5757514␤»

FROGGS m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1...20)}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«(timeout)»
FROGGS m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1...20)}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«(timeout)»

Found by pippo++

@p6rt
Copy link
Author

p6rt commented Aug 28, 2014

From @FROGGS

More bits​:
TimToady m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1..20)}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«1.9166325␤»
TimToady ... is a fairly heavyweight operator
TimToady though it really should know that 1...20 is constant foldable
TimToady m​: constant $range = 1..20; my $now = now; my @​a; for ^20_000 {@​a.push​: $range}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«3.3303724␤»
TimToady heh, that's slower?
TimToady m​: constant $range = eager 1..20; my $now = now; my @​a; for ^20_000 {@​a.push​: $range}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«2.90769890␤»
TimToady m​: constant $range = $(1..20); my $now = now; my @​a; for ^20_000 {@​a.push​: $range}; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«0.1451941␤»
TimToady oh wow
TimToady m​: constant $range = $(1..20); my $now = now; my @​a = $range xx 20000; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«0.3903180␤»
TimToady m​: constant range = $(1..20); my $now = now; my @​a = range xx 20000; say now - $now;
camelia rakudo-moar 69add2​: OUTPUT«0.0323894␤»

@p6rt
Copy link
Author

p6rt commented Aug 28, 2014

From @FROGGS

This might fix the regression​: rakudo/rakudo@3ce25eccf1

@p6rt
Copy link
Author

p6rt commented Aug 29, 2014

From @FROGGS

TimToady++'s patch indeed fixed it​:

FROGGS m​: my $now = now; my @​a; for ^20_000 {@​a.push​: $(1...20)}; say now - $now;
camelia rakudo-moar 54cd8f​: OUTPUT«4.275799␤»

@p6rt
Copy link
Author

p6rt commented Aug 29, 2014

@FROGGS - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant