From: makoto kuwata Date: 2007-12-13T17:50:00+09:00 Subject: Re: CGIAlt 0.0.1 released - an alternative library of 'cgi.rb' "ara.t.howard" wrote: > and i don't really see a huge improvement - but it's a very simply > program that may not take advantage of the performance features. can > you suggest a fcgi that should see a significant speedup? > CGIAlt and CGIExt are not the silver bullet for performance. If CGI class and it's methods were bottle neck of your application, CGIAlt and CGIExt would be good solution. But if not, you can't find improvement of performance. The following is an example of benchmarks. These benchmark scripts are included in CGIAlt package and you can try them. Table 1. summary of benchmark cgi.rb CGIAlt CGIAlt +CGIExt --------------------------------------------------------------------------- require "cgi" (x1000) 13.16 7.89 ( 67%) 9.18 ( 43%) CGI#new (simple) (x100000) 20.34 14.53 ( 40%) 12.46 ( 63%) CGI#new (comple) (x100000) 26.62 20.10 ( 32%) 13.19 (102%) CGI#header (simple) (x1000000) 12.68 6.05 (110%) 6.04 (110%) CGI#header (complex) (x1000000) 43.52 36.26 ( 20%) 36.62 ( 19%) Table 2. result of bench.fcgi Time taken for tests Request per second -------------------------------------------------------------------------- cgi + fcgi 16.686 [sec] 1198.61 [#/ sec] cgialt + cgialt/fcgi 15.562 [sec] 1285.18 [#/ sec] cgialt + cgialt/fcgi + cgiext 15.310 [sec] 1306.34 [#/ sec] CGIExt replaces CGI.escapeHTML and ERB::Util.h and makes them much faster. If you use a lot of '<%=h var %>', CGIExt will improve your application's performance. -- makoto kuwata