Kid vs Cheetah

78 views
Skip to first unread message

nEO (a.k.a. gentoo.cn)

unread,
Jul 26, 2006, 4:48:12 AM7/26/06
to turbo...@googlegroups.com
I just do a very simple ab test with Kid and Cheetah template in TG.
All test project is tg-admin quickstart project use default dev settings(only changed cp listen port).
Do a 100 concurents request and 10 concurents request each test, With redirect the output to /dev/null,
The test code do 100 times loop in controller and pass a list to template,  then template loop 100 times print the number out.


Kid controllers and template:
--------------------------------kid-controller---------------------------------
    @expose(template="ptestkid.templates.ptest")
    def ptest(self):
        times = 100
        t_list = []
        for t in xrange(times):
            t_list.append(str(t))

        return dict(t_list=t_list)
---------------------------------ptest.kid-------------------------------------
<html xmlns:py="http://purl.org/kid/ns#">
    <head><title>Performance test</title></head>
    <body>
        <li py:for="t in t_list">${t}</li>
    </body>
</html>
----------------------------------------------------------------------------------

---------------------------------cheetah-controller-----------------------
    @expose(template="cheetah:ptestcheetah.templates.ptest")
    def ptest(self):
        times = 100
        t_list = []
        for t in xrange(times):
            t_list.append(str(t))
        return dict(t_list=t_list)
----------------------cheetah----ptest.tmpl---------------------------------
<html>
    <head><title>Performance test</title></head>
    <body>
        #for $t in $t_list
        <li>$t</li>
        #end for
    </body>
</html>
---------------------------------------------------------------------------


The ab2 test results:
==========================================================================
Cheetah

gentoo ~ # ab2 -n 1000 -c 100 http://192.168.1.51:9080/ptest
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.51 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        CherryPy/2.2.1
Server Hostname:        192.168.1.51
Server Port:            9080

Document Path:          /ptest
Document Length:        1377 bytes

Concurrency Level:      100
Time taken for tests:   5.810028 seconds
Complete requests:      1000
Failed requests:        1
   (Connect: 0, Length: 1, Exceptions: 0)
Write errors:           0
Non-2xx responses:      1
Total transferred:      1505560 bytes
HTML transferred:       1378548 bytes
Requests per second:    172.12 [#/sec] (mean)
Time per request:       581.003 [ms] (mean)
Time per request:       5.810 [ms] (mean, across all concurrent requests)
Transfer rate:          253.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   66 440.2      0    3003
Processing:    13   77 101.4     47    1268
Waiting:        8   73 101.5     42    1268
Total:         13  144 475.2     47    4129

Percentage of the requests served within a certain time (ms)
  50%     47
  66%     55
  75%     68
  80%    125
  90%    179
  95%    230
  98%   3041
  99%   3064
 100%   4129 (longest request)
gentoo ~ #

gentoo ~ # ab2 -n 1000 -c 10 http://192.168.1.51:9080/ptest
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.51 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        CherryPy/2.2.1
Server Hostname:        192.168.1.51
Server Port:            9080

Document Path:          /ptest
Document Length:        1377 bytes

Concurrency Level:      10
Time taken for tests:   5.640210 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      1504000 bytes
HTML transferred:       1377000 bytes
Requests per second:    177.30 [#/sec] (mean)
Time per request:       56.402 [ms] (mean)
Time per request:       5.640 [ms] (mean, across all concurrent requests)
Transfer rate:          260.27 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    3  94.9      0    3002
Processing:    11   49  87.6     42    1638
Waiting:        8   45  87.5     38    1638
Total:         11   52 129.3     42    3056

Percentage of the requests served within a certain time (ms)
  50%     42
  66%     47
  75%     50
  80%     52
  90%     58
  95%     63
  98%     70
  99%     81
 100%   3056 (longest request)
gentoo ~ #


===============================================================================
Kid


gentoo ~ # ab2 -n 1000 -c 100 http://192.168.1.51:9080/ptest
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.51 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        CherryPy/2.2.1
Server Hostname:        192.168.1.51
Server Port:            9080

Document Path:          /ptest
Document Length:        1348 bytes

Concurrency Level:      100
Time taken for tests:   21.659279 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      1490000 bytes
HTML transferred:       1348000 bytes
Requests per second:    46.17 [#/sec] (mean)
Time per request:       2165.928 [ms] (mean)
Time per request:       21.659 [ms] (mean, across all concurrent requests)
Transfer rate:          67.18 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  438 1085.3      0    9000
Processing:    32 1142 2451.7    388   18649
Waiting:       31 1133 2449.0    375   18630
Total:         32 1580 3188.2    581   21650

Percentage of the requests served within a certain time (ms)
  50%    581
  66%   1082
  75%   1083
  80%   1084
  90%   3731
  95%  11142
  98%  11740
  99%  12108
 100%  21650 (longest request)
gentoo ~ #

gentoo ~ # ab2 -n 1000 -c 10 http://192.168.1.51:9080/ptest
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.51 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        CherryPy/2.2.1
Server Hostname:        192.168.1.51
Server Port:            9080

Document Path:          /ptest
Document Length:        1348 bytes

Concurrency Level:      10
Time taken for tests:   17.737777 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      1491490 bytes
HTML transferred:       1349348 bytes
Requests per second:    56.38 [#/sec] (mean)
Time per request:       177.378 [ms] (mean)
Time per request:       17.738 [ms] (mean, across all concurrent requests)
Transfer rate:          82.08 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    9 164.2      0    3002
Processing:    42  165 403.2    138    8055
Waiting:       37  151 403.3    122    8040
Total:         42  174 486.1    138   11057

Percentage of the requests served within a certain time (ms)
  50%    138
  66%    154
  75%    159
  80%    170
  90%    182
  95%    200
  98%    242
  99%    527
 100%  11057 (longest request)
gentoo ~ #



--
I'm the one, powered by nEO

Kevin Dangoor

unread,
Jul 26, 2006, 6:08:46 AM7/26/06
to turbo...@googlegroups.com
I'd be interested to see the same test run with Markup:


Kevin

Max Ischenko

unread,
Jul 27, 2006, 4:11:47 AM7/27/06
to TurboGears
Pure Kid vs. Cheetah tests (without web server/cheetah/TG code) can be
more revealing.

Max.

matt...@gmail.com

unread,
Jul 27, 2006, 12:20:31 PM7/27/06
to TurboGears
Kevin Dangoor wrote:
> I'd be interested to see the same test run with Markup:
>
> http://markup.edgewall.org/

Yeah, I'd like to see a benchmark of Markup vs. Cheetah as well.
Unfortunately the test Cheetah template has a strange recursion error,
so it's currently not runnable. If someone can figure out why this is
going into an infinite recursion please let me know:
http://markup.edgewall.org/browser/trunk/examples/bench/basic.py#L22

Current benchmarks of Markup and other templating languages are here:
http://markup.edgewall.org/wiki/MarkupPerformance

Work is still ongoing on optimizing portions of the engine in C, so
Markup's performance may have improved some since the benchmarks were
last made.

I plan to update the example of using Markup with TurboGears this week
and will make a more "official" announcement soon.

-- Matt Good

Michele Cella

unread,
Jul 27, 2006, 12:38:57 PM7/27/06
to TurboGears

Markup looks really cool, keep up the great work guys! :-)

Ciao
Michele

Arnar Birgisson

unread,
Jul 27, 2006, 1:03:19 PM7/27/06
to turbo...@googlegroups.com
On 7/27/06, Michele Cella <michel...@gmail.com> wrote:
> Markup looks really cool, keep up the great work guys! :-)

I agree. Is there a TG plugin for it? Kevin, are you looking at Markup
as a potential replacement as TG's default templating language?

Arnar

matt...@gmail.com

unread,
Jul 28, 2006, 3:20:33 PM7/28/06
to TurboGears

Yes, Markup already provides TurboGears support. There's an example
TurboGears app using Markup in the source:
http://markup.edgewall.org/browser/trunk/examples/turbogears

-- Matt Good

Jorge Vargas

unread,
Jul 28, 2006, 7:27:36 PM7/28/06
to turbo...@googlegroups.com

that seems it's using the same code just changing the templates, but in the config files you still have the defaults (kid).

Does markup makes setuptools believe it's kid?

as for it being an example is not the same as a tg template engine, ir you miss the part where you easy_install the tg markup pluging?

-- Matt Good



Damjan

unread,
Jul 29, 2006, 6:41:23 AM7/29/06
to TurboGears
> that seems it's using the same code just changing the templates, but in the
> config files you still have the defaults (kid).
>
> Does markup makes setuptools believe it's kid?

http://markup.edgewall.org/browser/trunk/examples/turbogears/markuptest/config/app.cfg
# which view (template engine) to use if one is not specified in the
# template name
tg.defaultview = "markup"

> as for it being an example is not the same as a tg template engine, ir you
> miss the part where you easy_install the tg markup pluging?

The markup package *itself* registers the TG plugin (actually the
template plugin system is not even specific to TG.. it can be used with
Buffet, too, isn't it?)

matt...@gmail.com

unread,
Jul 29, 2006, 10:29:49 AM7/29/06
to TurboGears
Jorge Vargas wrote:
> On 7/28/06, t...@matt-good.net <matt...@gmail.com> wrote:
> >
> >
> > Arnar Birgisson wrote:
> > > On 7/27/06, Michele Cella <michel...@gmail.com> wrote:
> > > > Markup looks really cool, keep up the great work guys! :-)
> > >
> > > I agree. Is there a TG plugin for it? Kevin, are you looking at Markup
> > > as a potential replacement as TG's default templating language?
> >
> > Yes, Markup already provides TurboGears support. There's an example
> > TurboGears app using Markup in the source:
> > http://markup.edgewall.org/browser/trunk/examples/turbogears
>
>
> that seems it's using the same code just changing the templates, but in the
> config files you still have the defaults (kid).

No, "tg.defaultview" is set to "markup" in "markup/config/app.cfg".

If there's another setting I should change please open a ticket on the
Markup Trac site:
http://markup.edgewall.org/

> as for it being an example is not the same as a tg template engine, ir you
> miss the part where you easy_install the tg markup pluging?

I'm not quire sure what you're getting at here. Markup provides the
same "python.templating.engines" entry point required for TG templating
engines. And yes it will need installed with easy_install, or the
"setup.py" script.

The example is definitely tested and fully-functional.

-- Matt Good

Jorge Vargas

unread,
Jul 29, 2006, 11:26:18 AM7/29/06
to turbo...@googlegroups.com

Jorge Vargas wrote:
> On 7/28/06, t...@matt-good.net <matt...@gmail.com> wrote:
> >
> >
> > Arnar Birgisson wrote:
> > > On 7/27/06, Michele Cella <michel...@gmail.com> wrote:
> > > > Markup looks really cool, keep up the great work guys! :-)
> > >
> > > I agree. Is there a TG plugin for it? Kevin, are you looking at Markup
> > > as a potential replacement as TG's default templating language?
> >
> > Yes, Markup already provides TurboGears support.  There's an example
> > TurboGears app using Markup in the source:
> > http://markup.edgewall.org/browser/trunk/examples/turbogears
>
>
> that seems it's using the same code just changing the templates, but in the
> config files you still have the defaults (kid).

No, "tg.defaultview" is set to "markup" in "markup/config/app.cfg".

ok now i see it. you should take out the comments form dev.cfg/app.cfg for that example.

If there's another setting I should change please open a ticket on the
Markup Trac site:
http://markup.edgewall.org/

> as for it being an example is not the same as a tg template engine, ir you
> miss the part where you easy_install the tg markup pluging?

I'm not quire sure what you're getting at here.  Markup provides the
same "python.templating.engines" entry point required for TG templating
engines.  And yes it will need installed with easy_install, or the
"setup.py" script.

so your saying that just installing markup makes it available to be use with TG, that's interesting although normally the TG plugins have been distributed as an aditional package call Turbo* http://www.turbogears.org/cogbin/

although your approach seems interesting, any change it may collide with another plugin, kid for example?

matt...@gmail.com

unread,
Jul 29, 2006, 12:35:51 PM7/29/06
to TurboGears
Jorge Vargas wrote:
> so your saying that just installing markup makes it available to be use with
> TG, that's interesting although normally the TG plugins have been
> distributed as an aditional package call Turbo*
> http://www.turbogears.org/cogbin/

Well, most templating engines were written before the template engine
plugin standard was created, so people have just created extra wrapper
packages to make them usable from TurboGears. There's no real
technical reason to keep them separate.

> although your approach seems interesting, any change it may collide with
> another plugin, kid for example?

Not unless Kid decides to change their package name to "markup" ;)

-- Matt Good

Jorge Godoy

unread,
Jul 29, 2006, 1:28:59 PM7/29/06
to turbo...@googlegroups.com
"t...@matt-good.net" <matt...@gmail.com> writes:

> Not unless Kid decides to change their package name to "markup" ;)
>
> -- Matt Good

Matt,


Can you please check if the information at
http://markup.edgewall.org/wiki/MarkupDownload is correct? I've tried using
the SVN repository with the command listed there and I got a 301 (moved
permanently) as a response. Mixing the repository from the easy_install
command with the subversion command worked...

I'll see if I can try markup here and how well it suits my already acquired
Kid knowledge :-)

--
Jorge Godoy <jgo...@gmail.com>

matt...@gmail.com

unread,
Jul 29, 2006, 2:33:35 PM7/29/06
to TurboGears

Well, it's right now. Jonas just fixed it 20 minutes ago.

-- Matt Good

Jorge Godoy

unread,
Jul 29, 2006, 2:43:37 PM7/29/06
to turbo...@googlegroups.com
"t...@matt-good.net" <matt...@gmail.com> writes:

> Well, it's right now. Jonas just fixed it 20 minutes ago.

Thanks! :-)

--
Jorge Godoy <jgo...@gmail.com>

Kevin Dangoor

unread,
Jul 29, 2006, 3:38:24 PM7/29/06
to turbo...@googlegroups.com
On Jul 29, 2006, at 11:26 AM, Jorge Vargas wrote:

so your saying that just installing markup makes it available to be use with TG, that's interesting although normally the TG plugins have been distributed as an aditional package call Turbo* http://www.turbogears.org/cogbin/

although your approach seems interesting, any change it may collide with another plugin, kid for example?


FYI: As Matt mentioned, the way Markup does it is actually what I view as the ideal. Template engines providing their own interfaces is a lot better than separately maintained ones (because who knows better how to use the engine than the people who made the engine?)

Kevin

ben.ha...@gmail.com

unread,
Jul 30, 2006, 9:03:12 PM7/30/06
to TurboGears
it looked cool

isaac

unread,
Jul 30, 2006, 11:53:12 PM7/30/06
to turbo...@googlegroups.com
Hi Matt,

I have a question for you, a little off topic...

Do you think switching to Markup will solve the issue I'm having
here: http://tinyurl.com/grv4v

(In short, I can't get kid to properly extend sitetemplate while
using py:layout -- the result is that the JS and CSS for widgets are
not automatically added.)

--------i

Reply all
Reply to author
Forward
0 new messages