Hi all,
Some info for the list: The latest changes to LexPerl does have a
considerable impact on performance, but user experience should not
affected unless you cause a large block to be lexed (e.g. pressing
^End) while on a slow machine. Here is some performance data for
evaluation.
The following are some data of selected lexers:
(Machine is an Athlon 2500+, using SciTE 1.64+ (Mingw))
Sample files are:
(a) lua1.lua (298K): aggregate of a few Lua exporter scripts
(b) Editor.cxx (207K): from Scintilla
(c) perlfunc.pod (265K): from perl5 library (simple sample)
(d) CPAN.pm (226K): from perl5 library (normal sample)
(e) lookback.pl (537K): 10,000 lines of the following:
$foo{ bar } / 1;
On the latest LexPerl in CVS, this will cause a
lookback/lookforward at 'bar', and a lookback at '/'. Essentially,
most locations will be scanned three times in the course of
lexing. This is a sort of worse-case scenario. (On 1.64, there is
just a single lookback at '/'.)
I ran a Lua script to repeat 'editor:Colourise(0, -1)' for at
least 30sec, so it involves colourising and folding of the entire
file repeatedly. The results are as follows:
For CVS version:
| MB/sec
lua1.lua | 5.8
Editor.cxx | 5.5
perlfunc.pod | 8.3 # a simple file is very fast
CPAN.pm | 1.3 # new perf not so good...
lookback.pl | 1.0 # worst case lookback/lookforward
For 1.64 version:
| MB/sec
perlfunc.pod | 8.6
CPAN.pm | 5.8 # old perf comparable to Lua/C lexer
lookback.pl | 1.8 # one lookback at '/'
The performance hit is a bit alarming, but LexPerl should still be
fast enough for most people. I guess bareword disambiguation is
currently more than a little inefficient, since my focus is on
correctness first. The CVS version of LexPerl performs lookback
and lookforward on *all* words, in order to disambiguate keywords
as well as quote-like delimiters from barewords, and that I guess
is a lot of processing. Comments welcome.
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest