Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gabor (1626)

  (email not shown publicly)

Perl developer and trainer []
Test automation using Perl []

Journal of gabor (1626)

Sunday March 01, 2009
01:57 AM

Improving the speed of PPI

[ #38571 ]
The biggest problem of PPI is that its slow. This causes any code depending on it such at Perl::Critic or the syntax highlighter of Padre to be slow. In the last couple of weeks Semuel Fomberg has been writing a replacement Tokenizer in C++.

See his status report.

I am sure he'll accept your help.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Through simple profiling, I got 30% in some simple hacking.

    • I don't know how much faster the C++ implementation can be but currently it is reasonable to use PPI in Padre only for files that are less than 300 lines long.
      • I recently wrote a custom XML syntax highlighter for Wx::STC. I found that if I tried to highlight more than a couple of hundred lines at a time it would be unacceptably slow. And even fewer lines if I waned to edit (and not just view) the document.

        I got around this by only styling lines that were visible. I used GetEndStyled() to tell me where I should begin styling, instead of starting at pos=0 every time. I stored state in SetLineState() which coupled with GetStyleAt() gave me enough information to kno