Skip Menu |

This queue is for tickets about the Test-PerlTidy CPAN distribution.

Report information
The Basics
Id: 121081
Status: rejected
Priority: 0/
Queue: Test-PerlTidy

People
Owner: Nobody in particular
Requestors: CHESNOKOV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 20130104
Fixed in: (no value)



Subject: Argument caching is disabled which makes is_file_tidy() slower on repeated calls
"perltidyrc" option to Perl::Tidy::perltidy() disables caching of parsed arguments, and this parsing takes about 30% of execution time (on my machine). To avoid that, command line option "--profile" should be used instead. Patched lines are: -- - perltidyrc => $perltidyrc, + argv => "--profile=$perltidyrc", -- Such a small change improves the speed of repeated calls by about 30%.
On Wed Apr 12 05:07:59 2017, CHESNOKOV wrote: Show quoted text
> "perltidyrc" option to Perl::Tidy::perltidy() disables caching of > parsed arguments, and this parsing takes about 30% of execution time > (on my machine). > To avoid that, command line option "--profile" should be used instead. > > Patched lines are: > > -- > - perltidyrc => $perltidyrc, > + argv => "--profile=$perltidyrc", > -- > > Such a small change improves the speed of repeated calls by about 30%.
Please see https://metacpan.org/pod/Code::TidyAll and perhaps bring it up with the perltidy dev.
On Fri Mar 08 19:05:58 2019, SHLOMIF wrote: Show quoted text
> > -- > > - perltidyrc => $perltidyrc, > > + argv => "--profile=$perltidyrc", > > -- > > > > Such a small change improves the speed of repeated calls by about > > 30%.
> > > Please see https://metacpan.org/pod/Code::TidyAll and perhaps bring it > up with the perltidy dev.
Hello and thanks for the answer. Unfortunately Code::TidyAll doesn't meet my requirements because there is a difference between tidying up a file and testing whether some file is tidy (did you mean Test::Code::TidyAll though?). All in all, in our project we've rewritten is_file_tidy() to consider a hack I proposed - so this bugreport was mostly an indication of how to save several (dozens) seconds of test execution on big codebases for other users. Looking at Code::TidyAll, it actually uses "argv", which is good - but using it still looks like an overkill when you only need to tidy up Perl code.