You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by wo...@kocjan.org on 2001/05/02 11:06:47 UTC

Re: mod_rewrite + mod_dtcl

Hello.

First of all, you are very cruel, David ;-) You forgot AOLserver.

And there, ns_register_proc is used mainly for putting code which is
a) reused
b) fast

Here are some benchmarks, which I find quite interesting.
hello1 is a simple hello world,
hello2 is "hello world\n" in a 'for' loop
hello2_ is [string repeat "Hello world\n"1000] (or equivalent).

I didn't test anything with tclhttpd, as it's not as fast as
dtcl/php/aol.

apache/php:
hello1  125-165
hello2_ 45-50

apache/dtcl:
hello1  115-140
hello2  30-35
hello2_ 75-80

aolserver/adp:
hello1  190-230
hello2  20-25
hello2_ 140

aolserver/ns_register: (like hooks in tclhttpd)
hello1  240
hello2_ 155

The numbers are requests per second, so the bigger the better.
Actually, these numbers are quite interesting as they show some things:
1. hooks are generally faster
2. aolserver+adp is still faster than dtcl :(
3. it's more useful to use [string repeat] than to *puts on loop
4. aolserver is slow when using many ns_puts statements (see adp/hello2
   and adp/hello2_) - hputs is faster than ns_puts ;-)
5. tcl is generally faster than php

It's also possible to use /dtcl.ttml/* instead of /dtcl, make
/dtcl.ttml a file - it'll get parsed with the rest of URI in
$ENVS(PATH_INFO) [ie. /dtcl.ttml/john/doe will produce '/john/doe' in
$ENVS(PATH_INFO)].

Also, hooks in tclhttpd have another meaning, they are used when
tclhttpd is embedded in an application - it's then easier to call a proc
which is a part of that application than to write a file which gets
parsed... it's also less resource consuming (except that bytecode of
that proc is stored in memory).

-- 
Wojtek Kocjan
wojciech@kocjan.org