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

Re: Timing: first results : 30%



On Mon, Jan 04, 1999, Denis Barbier wrote:

> Happy new year, all.
> 
> This week-end i found interesting improvements in execution time.
> Here is a typical timing when building my site pages:
> 
> ** WML:Verbose: main |  ipp   mhc   epl  gm4  div asub hfix hstr slic | TOTAL
> ** WML:Verbose: ---- | ---- ----- ----- ---- ---- ---- ---- ---- ---- | ------
> ** WML:Verbose: 0.89 | 7.97  7.53  5.23 0.16 0.14 0.10 0.36 0.31 0.63 | 23.32
>                        ^^^^
>                      look here
> 
> The first pass is the most significant, even if actions during this pass
> are quite simple and straightforward. It's why i proposed to include
> files verbatim. In fact, most of the time is spent in comment block parser.
> When disabling this parser, timing becomes
> 
> ** WML:Verbose: main |  ipp   mhc   epl  gm4  div asub hfix hstr slic | TOTAL
> ** WML:Verbose: ---- | ---- ----- ----- ---- ---- ---- ---- ---- ---- | ------
> ** WML:Verbose: 0.82 | 0.66  7.49  5.01 0.17 0.14 0.08 0.34 0.31 0.63 | 15.65
> 
> In my source files, i have a line
> #include "packages.wml"
> This file ``packages.wml'' contains ``#use'' directives ; in this case,
> it includes 10 packages. I type
> prompt> wml -p1 packages.wml > packages.pass1
> and replace the previous line by
> #include "packages.pass1"
> 
> Results are:
> ** WML:Verbose: main |  ipp   mhc   epl  gm4  div asub hfix hstr slic | TOTAL
> ** WML:Verbose: ---- | ---- ----- ----- ---- ---- ---- ---- ---- ---- | ------
> ** WML:Verbose: 0.82 | 0.53  7.43  5.09 0.16 0.15 0.09 0.33 0.33 0.69 | 15.62
> 
> >From 8 seconds to half a second, this is really nice. Now one has to
> work on steps 2 and 3.

Hey, that's fantastic!  Actually the block comments are just a goodie which
usually aren't used such widely. So the speed increase should be noticeable to
a lot of users.

> Here is the patch i wrote. It is really simple, and needed minimal
> testings. It invokes parseblock only if a sequence '/*' is found in
> input files. Perl gurus may want to optimize BlockParser.pm, i can't.

Yes, the BlockParser stuff is slow because it contains a real parser which
also understands nested blocks, etc. Perhaps too much functionality.  Hmmmm...
but interesting to now this.
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com