Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-08 Thread Dieter Maurer

Joachim Werner writes:
 > Has anyone done any performance comparisons between DTML and ZPT yet? The
 > reason I'm asking is that we did some first(completely unscientific) tests
 > and had the impression that ZPT were actually quite a bit SLOWER than DTML -
 > and I just can't believe that ...
While essential parts of DTML rendering is implemented in C,
ZPT rendering is pure Python...


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-08 Thread Shane Hathaway

seb bacon wrote:
> Well, I just ran a very naive test and it suggests that zpt may be about
> twice as slow as dtml.
> 
> I made a DTML Method, and a ZPT, identical to each other, containing
> only HTML:
> 
>
>Test
>   
> 
> Then I ran the ab benchmarking tool against each method, thus:
> 
>   # ab -n 500 http://localhost:8005/zpt_test/dtml
> 
> The results are reproduced below, along with the profiling information
> (sorry if it wraps badly)

This is useful information, but it's hard to make sense of it.  For one 
thing, where are the calls to BaseRequest.traverse() in the ZPT test? 
Also, the info seems to suggest that ZPT took 7.810 seconds (total) to 
pt_render(), while DTML took 0.640 seconds (total) to __call__(), but 
there's no suggestion as to why.

Shane



> 
> 1. DTML Method
> 
> HTML transferred:   1 bytes
> Requests per second:88.15 [#/sec] (mean)
> Time per request:   11.34 [ms] (mean)
> Time per request:   11.34 [ms] (mean, across all concurrent
> requests)
> Transfer rate:  21.16 [Kbytes/sec] received
> 
>  ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>   5010.0900.0005.5800.011 profile:0()
>   5010.0500.0005.4900.011 Publish.py:367(pm)
>   5010.0200.0005.4400.011
> Publish.py:206(publish_module)
>   5010.2000.0005.4200.011 Publish.py:122(publish)
>   5010.7300.0012.2300.004
> BaseRequest.py:231(traverse)
>   5010.2000.0001.4800.003 mapply.py:104(mapply)
>   5010.0500.0000.9900.002
> Publish.py:111(call_object)
>   5000.1700.0000.9300.002
> DTMLMethod.py:168(__call__)
>   5000.3100.0010.6400.001 DT_String.py:434(__call__)
>   5010.0200.0000.5600.001
> BaseResponse.py:125(outputBody)
>   5010.1000.0000.4300.001
> __init__.py:247(recordMetaData)
> 
> -
> 
> 2. ZPT
> 
> HTML transferred:   10500 bytes
> Requests per second:47.65 [#/sec] (mean)
> Time per request:   20.99 [ms] (mean)
> Time per request:   20.99 [ms] (mean, across all concurrent
> requests)
> Transfer rate:  11.48 [Kbytes/sec] received
> 
>  ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>   5050.1300.000   13.1200.026 profile:0()
>   5050.0200.000   12.9900.026 Publish.py:367(pm)
>   5050.0800.000   12.9700.026
> Publish.py:206(publish_module)
>   5050.3100.001   12.2200.024 Publish.py:122(publish)
>   5050.0500.0008.3700.017 mapply.py:104(mapply)
>   5050.0100.0008.3200.016
> Publish.py:111(call_object)
>   5050.0400.0008.3100.016 Bindings.py:322(__call__)
>   5050.0500.0008.2700.016
> Bindings.py:342(_bindAndExec)
>   5000.2200.0008.1400.016
> ZopePageTemplate.py:238(_exec)
>   5000.1100.0007.8100.016
> PageTemplate.py:143(pt_render)
>


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-08 Thread Jim Penny

On Fri, Feb 08, 2002 at 11:29:39AM +, seb bacon wrote:
> Well, I just ran a very naive test and it suggests that zpt may be about
> twice as slow as dtml.
> 
> I made a DTML Method, and a ZPT, identical to each other, containing
> only HTML:
> 
>
>Test
>   
> 
> Then I ran the ab benchmarking tool against each method, thus:
> 
>   # ab -n 500 http://localhost:8005/zpt_test/dtml
> 
> The results are reproduced below, along with the profiling information
> (sorry if it wraps badly)
> 
> seb

snip - snip.

This is indeed very interesting.  I also had an impression that ZPT was
sometimes evaluating things that it did not need to in the presence
of conditional tags.

How does the timing compare with a Script Python and with an external 
method on your machine?

(Yes, I understand they are very different from ZPT and dtml, but I
think this might be useful information for a Zope architect. And this 
would give a common baseline.)


Jim Penny

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-08 Thread seb bacon

Well, I just ran a very naive test and it suggests that zpt may be about
twice as slow as dtml.

I made a DTML Method, and a ZPT, identical to each other, containing
only HTML:

   
   Test
  

Then I ran the ab benchmarking tool against each method, thus:

  # ab -n 500 http://localhost:8005/zpt_test/dtml

The results are reproduced below, along with the profiling information
(sorry if it wraps badly)

seb


1. DTML Method

HTML transferred:   1 bytes
Requests per second:88.15 [#/sec] (mean)
Time per request:   11.34 [ms] (mean)
Time per request:   11.34 [ms] (mean, across all concurrent
requests)
Transfer rate:  21.16 [Kbytes/sec] received

 ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  5010.0900.0005.5800.011 profile:0()
  5010.0500.0005.4900.011 Publish.py:367(pm)
  5010.0200.0005.4400.011
Publish.py:206(publish_module)
  5010.2000.0005.4200.011 Publish.py:122(publish)
  5010.7300.0012.2300.004
BaseRequest.py:231(traverse)
  5010.2000.0001.4800.003 mapply.py:104(mapply)
  5010.0500.0000.9900.002
Publish.py:111(call_object)
  5000.1700.0000.9300.002
DTMLMethod.py:168(__call__)
  5000.3100.0010.6400.001 DT_String.py:434(__call__)
  5010.0200.0000.5600.001
BaseResponse.py:125(outputBody)
  5010.1000.0000.4300.001
__init__.py:247(recordMetaData)

-

2. ZPT

HTML transferred:   10500 bytes
Requests per second:47.65 [#/sec] (mean)
Time per request:   20.99 [ms] (mean)
Time per request:   20.99 [ms] (mean, across all concurrent
requests)
Transfer rate:  11.48 [Kbytes/sec] received

 ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  5050.1300.000   13.1200.026 profile:0()
  5050.0200.000   12.9900.026 Publish.py:367(pm)
  5050.0800.000   12.9700.026
Publish.py:206(publish_module)
  5050.3100.001   12.2200.024 Publish.py:122(publish)
  5050.0500.0008.3700.017 mapply.py:104(mapply)
  5050.0100.0008.3200.016
Publish.py:111(call_object)
  5050.0400.0008.3100.016 Bindings.py:322(__call__)
  5050.0500.0008.2700.016
Bindings.py:342(_bindAndExec)
  5000.2200.0008.1400.016
ZopePageTemplate.py:238(_exec)
  5000.1100.0007.8100.016
PageTemplate.py:143(pt_render)


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-08 Thread Chris Withers

Richard Jones wrote:
> 
> That's only during parsing - the result of the ZPT parse is a highly
> optimised rendering structure.

Not highly optimised enough if what Martijn says is true ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-07 Thread Martijn Faassen

Chris Withers wrote:
> seb bacon wrote:
> > 
> > It wouldn't surprise me - ZPT has the roughly the same overheads as DTML
> > for the language parsing, but a presentation template goes through an
> > HTML parser in addition - which is always going to be quite slow in
> > python.
> 
> IIRC, The HTML Parser is only used during compilation, not on every render.
> 
> I would have thought it'd eb a priority to get ZPT to be at least as fast as
> DTML...

Last I heard there was a benchmark it said ZPT was about 40% slower
than DTML, and they were quite happy about this as DTML does all kinds of
funky optimization while ZPT did not. I forget where I read that though,
and it was a while ago, and I may not remember that figure right.

Regards,

Martijn


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-07 Thread Richard Jones

On Thu, 7 Feb 2002 20:53, seb bacon wrote:
> Hi!
>
> It wouldn't surprise me - ZPT has the roughly the same overheads as DTML
> for the language parsing, but a presentation template goes through an
> HTML parser in addition - which is always going to be quite slow in
> python.

That's only during parsing - the result of the ZPT parse is a highly 
optimised rendering structure.


Richard

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-07 Thread Chris Withers

seb bacon wrote:
> 
> It wouldn't surprise me - ZPT has the roughly the same overheads as DTML
> for the language parsing, but a presentation template goes through an
> HTML parser in addition - which is always going to be quite slow in
> python.

IIRC, The HTML Parser is only used during compilation, not on every render.

I would have thought it'd eb a priority to get ZPT to be at least as fast as
DTML...

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-07 Thread seb bacon

Hi!

It wouldn't surprise me - ZPT has the roughly the same overheads as DTML
for the language parsing, but a presentation template goes through an
HTML parser in addition - which is always going to be quite slow in
python.

seb

On Thu, 2002-02-07 at 00:01, Joachim Werner wrote:
> Hello!
> 
> Has anyone done any performance comparisons between DTML and ZPT yet? The
> reason I'm asking is that we did some first(completely unscientific) tests
> and had the impression that ZPT were actually quite a bit SLOWER than DTML -
> and I just can't believe that ...
> 
> Joachim
> 
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-06 Thread Derek Simkowiak

-> Has anyone done any performance comparisons between DTML and ZPT yet? The
-> reason I'm asking is that we did some first(completely unscientific) tests
-> and had the impression that ZPT were actually quite a bit SLOWER than DTML -
-> and I just can't believe that ...

I haven't done any tests (or even used ZPT on a production site 
yet), but I'd be shocked if there was any significant speed difference at 
all.

If there *is* a measurable difference, then somebody really futzed 
up the ZPT parser (enough to have it classified as a bug).







___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Benchmarks: DTML vs. ZPT?

2002-02-06 Thread Joachim Werner

Hello!

Has anyone done any performance comparisons between DTML and ZPT yet? The
reason I'm asking is that we did some first(completely unscientific) tests
and had the impression that ZPT were actually quite a bit SLOWER than DTML -
and I just can't believe that ...

Joachim


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )