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)