Foo Ji-Haw wrote:
That's odd. I thought I remembered reading up about discouraging the use of the CGI module in optimising modperl. The rationale (if I remembered right) is that CGI depends on the %ENV, which populating it for every call is an effort. The recommended way is to turn of SetupEnv, and grab as much stuff from Apache2::RequestRec as possible.

Sure, libapreq and its included modules are the fastest way to parse parameters and handle cookies. However, hardly anyone needs that speed. Most people are spending all of their time talking to a database or doing other I/O tasks, or have pretty minimal web traffic, or both.

If you're writing something new, and you don't care about supporting CGI, and you want to use the fastest option, by all means give libapreq a try. For most people though, it won't make any measurable difference which one you use. I wouldn't advise anyone to bother changing CGI.pm code unless they've run a profiler and seen it show up high enough to matter.

It's easy to get caught up in optimizing tiny things that won't make a noticeable difference, instead of working on things that will really count. Don't fall into that trap.

- Perrin

Reply via email to