Benchmarks: DTML vs. ZPT?
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
-> 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).
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 - Zope-Dev@zope.org 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 )
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
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
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
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: <html> Test </html> 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: 10000 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) 501 0.090 0.000 5.580 0.011 profile:0() 501 0.050 0.000 5.490 0.011 Publish.py:367(pm) 501 0.020 0.000 5.440 0.011 Publish.py:206(publish_module) 501 0.200 0.000 5.420 0.011 Publish.py:122(publish) 501 0.730 0.001 2.230 0.004 BaseRequest.py:231(traverse) 501 0.200 0.000 1.480 0.003 mapply.py:104(mapply) 501 0.050 0.000 0.990 0.002 Publish.py:111(call_object) 500 0.170 0.000 0.930 0.002 DTMLMethod.py:168(__call__) 500 0.310 0.001 0.640 0.001 DT_String.py:434(__call__) 501 0.020 0.000 0.560 0.001 BaseResponse.py:125(outputBody) 501 0.100 0.000 0.430 0.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) 505 0.130 0.000 13.120 0.026 profile:0() 505 0.020 0.000 12.990 0.026 Publish.py:367(pm) 505 0.080 0.000 12.970 0.026 Publish.py:206(publish_module) 505 0.310 0.001 12.220 0.024 Publish.py:122(publish) 505 0.050 0.000 8.370 0.017 mapply.py:104(mapply) 505 0.010 0.000 8.320 0.016 Publish.py:111(call_object) 505 0.040 0.000 8.310 0.016 Bindings.py:322(__call__) 505 0.050 0.000 8.270 0.016 Bindings.py:342(_bindAndExec) 500 0.220 0.000 8.140 0.016 ZopePageTemplate.py:238(_exec) 500 0.110 0.000 7.810 0.016 PageTemplate.py:143(pt_render)
On Fri, Feb 08, 2002 at 11:29:39AM +0000, 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:
<html> Test </html>
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
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:
<html> Test </html>
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: 10000 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) 501 0.090 0.000 5.580 0.011 profile:0() 501 0.050 0.000 5.490 0.011 Publish.py:367(pm) 501 0.020 0.000 5.440 0.011 Publish.py:206(publish_module) 501 0.200 0.000 5.420 0.011 Publish.py:122(publish) 501 0.730 0.001 2.230 0.004 BaseRequest.py:231(traverse) 501 0.200 0.000 1.480 0.003 mapply.py:104(mapply) 501 0.050 0.000 0.990 0.002 Publish.py:111(call_object) 500 0.170 0.000 0.930 0.002 DTMLMethod.py:168(__call__) 500 0.310 0.001 0.640 0.001 DT_String.py:434(__call__) 501 0.020 0.000 0.560 0.001 BaseResponse.py:125(outputBody) 501 0.100 0.000 0.430 0.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) 505 0.130 0.000 13.120 0.026 profile:0() 505 0.020 0.000 12.990 0.026 Publish.py:367(pm) 505 0.080 0.000 12.970 0.026 Publish.py:206(publish_module) 505 0.310 0.001 12.220 0.024 Publish.py:122(publish) 505 0.050 0.000 8.370 0.017 mapply.py:104(mapply) 505 0.010 0.000 8.320 0.016 Publish.py:111(call_object) 505 0.040 0.000 8.310 0.016 Bindings.py:322(__call__) 505 0.050 0.000 8.270 0.016 Bindings.py:342(_bindAndExec) 500 0.220 0.000 8.140 0.016 ZopePageTemplate.py:238(_exec) 500 0.110 0.000 7.810 0.016 PageTemplate.py:143(pt_render)
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
participants (9)
-
Chris Withers -
Derek Simkowiak -
Dieter Maurer -
Jim Penny -
Joachim Werner -
Martijn Faassen -
Richard Jones -
seb bacon -
Shane Hathaway