[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: highlighting-kate is sometimes too heavy



+++ Joachim Breitner [Mar 06 10 23:10 ]:
> Hi,
> 
> Am Samstag, den 06.03.2010, 13:39 -0800 schrieb John MacFarlane:
> > > I've used both your suggestions (using Set instead of list for
> > > keywords, and using the trick with "words" to keep ghc from
> > > inlining), and produced a new version, 0.2.6.1, which is now
> > > on HackageDB.
> > > 
> > > A comparison:
> > >                                     old       new
> > > compile time inc. executable        5:45      3:39
> > > time to highlight a 102K file       1:69      1:59
> > > size of Highlight executable       10.5M      5.7M
> > > 
> > > Great improvements all around!  Thanks!  I hope this version
> > > can be packaged for debian.
> 
> Thanks, uploaded right now.

Joachim:

I just uploaded another version, 0.2.6.2, that is even faster to
compile. (2:53 on the same machine that took 3:39 for 0.2.6.1, to
compile the library + executable.) The trick was to have separate
definitions for the compiled regexes. (Run time is no faster,
unfortunately. Profiling shows that Highlight spends most of its time in
the matchRegex function, even when using the Haskell parser, which only
has a few regex rules. matchRegex just calls pcre-light's match with a
precompiled Regex, so I don't see much room for improvement there.)

John


Reply to: