Re: Linux Hello World: TT Optimized...
On Mon, Dec 11, 2000 at 10:14:56PM -0800, Joshua Chamas wrote: > [EMAIL PROTECTED] 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. > > 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. > > --Josh
Re: Linux Hello World: TT Optimized...
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 _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Linux Hello World: TT Optimized...
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!
Re: Linux Hello World: TT Optimized...
[EMAIL PROTECTED] wrote: > > Could you please explain the differences between > CGI Raw and CGI.pm? I'm using oo method of > CGI. > > 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. > > 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. --Josh
Re: Linux Hello World: TT Optimized...
Could you please explain the differences between CGI Raw and CGI.pm? I'm using oo method of CGI. 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 FileHits/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 5 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 5 hits 56.45 sec >0.001129 > Template Toolkit hello.tt 560.3 33622 hits 60.01 sec >0.001785 > > -- Josh > > _ > Joshua Chamas Chamas Enterprises Inc. > NodeWorks >> free web link monitoring Huntington Beach, CA USA > http://www.nodeworks.com1-714-625-4051
Linux Hello World: TT Optimized...
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 FileHits/sec Total Hits Total Time sec/Hits Apache::ASP hello.asp 414.1 24846 hits 60.00 sec0.002415 Apache::Registry CGI Raw hello_raw.re 741.7 44502 hits 60.00 sec0.001348 Apache::Registry CGI.pm hello.reg 500.0 30001 hits 60.00 sec0.002000 HTML Static hello.html 1215.7 5 hits 41.13 sec0.000823 HTML::Embperl hello.epl 509.6 30579 hits 60.00 sec0.001962 HTML::Mason hello.mas 385.9 23153 hits 60.00 sec0.002592 ModPerl Handler hello.bench 885.8 5 hits 56.45 sec0.001129 Template Toolkit hello.tt 560.3 33622 hits 60.01 sec0.001785 -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks >> free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051