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
parameters, even if unused, make stuff slower ( f1($a, $, $, $, $, $) vs f2($a, $b, $c, $d, $e, $f) ) #6617
Comments
From @AlexDanielCode: Result: Code: Result: None of the params are used but still replacing them with just $ makes things run faster. The difference is measurable and you can increase the number of loops to observe it even better. This ticket is motivated by a pull request which used that observation to speed things up in rakudo: rakudo/rakudo#1196 This is Rakudo version 2017.09-375-ga0f29e0df built on MoarVM version 2017.09.1-594-gb9d3f6da |
From @AlexDanielOh, I guess it applies to methods as well. On 2017-10-14 20:10:15, alex.jakimenko@gmail.com wrote:
|
From @AlexDanielFWIW I made a throwaway script that looks for unused params, and there are many of these in rakudo sources. Of course, most of these cases are not in hot paths, but the overall performance benefit may be very noticeable. There are also cases like this: https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Socket/Async.pm#L313-L315 Dunno if I should post the results. There are many false-positives and I guess many cases are not caught at all, so a proper approach is needed if we really want to replace all these with $. On 2017-10-14 20:12:49, alex.jakimenko@gmail.com wrote:
|
From @AlexDanielAnd not only parameters, but unused variables also: On 2017-10-14 20:53:03, alex.jakimenko@gmail.com wrote:
|
From @zoffixznetOn Sat, 14 Oct 2017 20:53:03 -0700, alex.jakimenko@gmail.com wrote:
Wouldn't a warning about unused variables be more appropriate That Proc::Async line you point out actually has a bug in it and a warning would've detected it. |
The RT System itself - Status changed from 'new' to 'open' |
From @AlexDanielYes, it would be awesome to have warnings for unused params and variables. On 2018-01-14 12:16:08, cpan@zoffix.com wrote:
|
Migrated from rt.perl.org#132306 (status was 'open')
Searchable as RT132306$
The text was updated successfully, but these errors were encountered: