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

seb bacon seb@jamkit.com
08 Feb 2002 11:29:39 +0000


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)