From: "Matt Sergeant" <[EMAIL PROTECTED]>
To: "Stas Bekman" <[EMAIL PROTECTED]>
Cc: "___cliff rayman___" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: 08 June 2000 09:23
Subject: Re: [performance/benchmark] printing techniques


: On Wed, 7 Jun 2000, Stas Bekman wrote:
:
: > On Wed, 7 Jun 2000, ___cliff rayman___ wrote:
: >
: > >
: > >
: > > Stas Bekman wrote:
: > >
: > > >
: > > >
: > > > Per your request:
: > > >
: > > > The handler:
: > > >
: > > > query         | avtime completed failed    rps
: > > > -----------------------------------------------
: > > > single_print  |    110      5000      0    881
: > > > here_print    |    111      5000      0    881
: > > > list_print    |    111      5000      0    880
: > > > concat_print  |    111      5000      0    873
: > > > multi_print   |    119      5000      0    820
: > > > -----------------------------------------------
: > >
: > > not very much difference once stuck in a handler.
: > > obviously multi_print is both ugly and slow, but the rest should be
used by the
: > > discretion of the programmer based on the one that is easiest to
maintain in
: > > the code.
: >
: > absolutely. I'd also love to know why is it different under the handler.
: > (talking about relative performance!)
:
: Because as I said - the method dispatch and the overhead of the mod_perl
: handler takes over. multi-print is the only one that has to call methods
: several times. The rest are almost equal.
:
: This also demonstrates some of the value in template systems that send all
: their output at once, however often these template systems use method
: calls too, so it all gets messed up.

This may be veering off topic - but its been on my mind for a while now ....

Apart from thanking Stas for his benchmark work, which I find very
interesting (does he sleep ;-) - this and few few others (benchmarks) have
all touched on the area of including mod_perl output within HTML.  I have
always wonder what everyone else is doing on this front.

I usually suck a template into memory (one long line) - usually done at
startup.  I then create all the conent with either pushing onto an array, or
.= string concatination.  Finally I regex the template - looking for my tags
and replave those with output.  Needless to say that one page can onsists of
many templates (page or inside of table (bits from <tr> </tr>) etc ...).

>From Stas previous benchmarks I've preloaded the mysql driver and now
usually use the "push" onto array to prepare content - Thanks Stas.

Who does everyone else do it ? Can this type of operation (that everyone
must do at some time) be optimised as aggressively as some of the others ?
Yet still keep the abstraction between design and content.

Greg Cope

:
: --
: <Matt/>
:
: Fastnet Software Ltd. High Performance Web Specialists
: Providing mod_perl, XML, Sybase and Oracle solutions
: Email for training and consultancy availability.
: http://sergeant.org http://xml.sergeant.org
:
:

Reply via email to