This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: Re: Linux Hello World: TT Optimized... From: newsreader@mediaone.net Date: Mon, 11 Dec 2000 23:02:59 -0500 Thanks On Mon, Dec 11, 2000 at 07:56:03PM -0800, Joshua Chamas wrote: > Hey, > > Updated results from the other day with the Template Toolkit > benchmark properly optimized, thanks Perrin! > > The reference for these numbers is at: http://www.chamas.com/bench > If you would like the hello test suite, please email me separately. > > ]# ./bench.pl -time=60 > > Test Name Test File Hits/sec Total Hits Total Time sec/Hits > ------------ ------------ ------------ ------------ ------------ ------------ > Apache::ASP hello.asp 414.1 24846 hits 60.00 sec 0.002415 > Apache::Registry CGI Raw hello_raw.re 741.7 44502 hits 60.00 sec 0.001348 > Apache::Registry CGI.pm hello.reg 500.0 30001 hits 60.00 sec 0.002000 > HTML Static hello.html 1215.7 50000 hits 41.13 sec 0.000823 > HTML::Embperl hello.epl 509.6 30579 hits 60.00 sec 0.001962 > HTML::Mason hello.mas 385.9 23153 hits 60.00 sec 0.002592 > ModPerl Handler hello.bench 885.8 50000 hits 56.45 sec 0.001129 > Template Toolkit hello.tt 560.3 33622 hits 60.01 sec 0.001785 > Could you please explain the differences between CGI Raw and CGI.pm? I'm using oo method of CGI. === Subject: Re: Linux Hello World: TT Optimized... From: Joshua Chamas <joshua@chamas.com> Date: Mon, 11 Dec 2000 22:14:56 -0800 newsreader@mediaone.net wrote: > On Mon, Dec 11, 2000 at 07:56:03PM -0800, Joshua Chamas wrote: > > Updated results from the other day with the Template Toolkit > > benchmark properly optimized, thanks Perrin! > > > > The reference for these numbers is at: http://www.chamas.com/bench > > If you would like the hello test suite, please email me separately. > Could you please explain the differences between > CGI Raw and CGI.pm? I'm using oo method of > CGI. See http://www.chamas.com/bench/#perlcgi The Raw CGI test makes no use of CGI.pm, just issues raw print statements that sets up the right CGI headers. Please note that the number that I reported showed a difference of .00065 seconds of system time per request between CGI.pm & Raw CGI HelloWorld, so I wouldn't much worry about the environment overhead. If you are using CGI.pm object methods, I would worry about calling all those methods to build your HTML and if you are performance minded, I would use them frugally. === Subject: Re: Linux Hello World: TT Optimized... From: "Jeremy Howard" <jh_lists@fastmail.fm> Date: Tue, 12 Dec 2000 17:22:12 +1100 Joshua Chamas wrote: > If you are using CGI.pm object methods, I would worry about calling > all those methods to build your HTML and if you are performance > minded, I would use them frugally. IIRC, CGI.pm is actually slower to run the functional syntax than the object syntax. This is because accessing CGI's functions end up getting dispatched through a complex autoload(ish) mechanism. I haven't benchmarked this though, so it's only theory! === Subject: Re: Linux Hello World: TT Optimized... From: Stas Bekman <stas@stason.org> Date: Tue, 12 Dec 2000 13:01:11 +0100 (CET) On Tue, 12 Dec 2000, Jeremy Howard wrote: > Joshua Chamas wrote: > > If you are using CGI.pm object methods, I would worry about calling > > all those methods to build your HTML and if you are performance > > minded, I would use them frugally. > > > IIRC, CGI.pm is actually slower to run the functional syntax than the object > syntax. This is because accessing CGI's functions end up getting dispatched > through a complex autoload(ish) mechanism. > > I haven't benchmarked this though, so it's only theory! It's documentated and benchmarked in the guide: http://perl.apache.org/guide/performance.html#Object_Methods_Calls_vs_Functio http://perl.apache.org/guide/performance.html#Are_All_Methods_Slower_than_Func === Subject: Re: Linux Hello World: TT Optimized... From: newsreader@mediaone.net Date: Tue, 12 Dec 2000 16:57:41 -0500 On Mon, Dec 11, 2000 at 10:14:56PM -0800, Joshua Chamas wrote: > newsreader@mediaone.net wrote: > > > > Could you please explain the differences between > > CGI Raw and CGI.pm? I'm using oo method of > > CGI. > The Raw CGI test makes no use of CGI.pm, just issues raw print > statements that sets up the right CGI headers. Please note that the > number that I reported showed a difference of .00065 seconds of system > time per request between CGI.pm & Raw CGI HelloWorld, so I wouldn't much > worry about the environment overhead. Oh you meant cgi. CGI should be reserved for CGI.pm stuff. I don't use CGI's html functions at all because I just don't see much saving in terms of typing. I guess I am in between your 'RAW' case and CGI.pm case I only use CGI's param,header,cookie and redirect functions and DISABLE_UPLOADS and POST_MAX variables. Given that real handler is the second best performer after static html I wonder how big of a step from using Registry to writing a handler. I know I can rely on CGI because it is time tested. I wonder whether there are CGI equivalent modules if I don't use handler. I read earlier that CGI alternatives have some problems. ===