Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: perlcritic speedup

by jthalhammer (Friar)
on Jan 25, 2012 at 06:16 UTC ( #949835=note: print w/ replies, xml ) Need Help??


in reply to perlcritic speedup

Perl::Critic has been through several rounds of optimizations, so I doubt you'll be able to squeeze much more performance out of it (but patches are always welcome).

Most of the time is spent within PPI, parsing the file. So running a client/server arrangement won't help much. However, installing PPI::XS will give you a small speedup.

Tuning your policy set might help some. Certain polices like like RequireTidyCode are considerably more intensive than others. Also, any policy that has 'PPI::Document' or 'PPI::Token::Word' in the applies_to method tends to be slower than other policies that have a more narrow focus. So if you can disable those policies (or just run them less often), then you might get a little better results.

Editors like Komodo run Perl::Critic in the background as you edit the file, so you don't notice the performance as much. Perhaps you could get vim to do the same?

Never mind folks that tell you when to save your files or how often to critique or syntax-check your code. Everyone has a different workflow. Do whatever works best for you.

Jeffrey Thalhammer
Imaginative Software Systems


Comment on Re: perlcritic speedup
Re^2: perlcritic speedup
by powerman (Friar) on Jan 25, 2012 at 08:24 UTC

    Hmm. I was thinking about running perlcritic in background, but I didn't understood how this should work. Background perlcritic process will check some previous version of editing file, because I'll change it while perlcritic is running. So, when perlcritic will return it results, the line numbers in it output won't match current line numbers, some perlcritic messages won't be actual anymore, etc. This way perlcritic messages should confuse more than help.

    It probably possible to try to calculate differences between these two file versions, and fix perlcritic messages (at least line numbers) before showing them. But I don't sure this can be implemented in reliable way, to avoid showing non-actual anymore perlcritic messages.

        Yeah, I know about them. But I write code in many languages, not just in Perl, so I prefer to use plugins which behave in same way for any language (like syntastic, snipmate, viewdoc, tcomment, etc.) instead of language-specific plugins like perl-support.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-08-23 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls