in reply to CGI speed: one script versus many modules

As derby said. The key is in the breakeven point between the time spent loading vs compiling code.

If you only need a fraction of your code to process any specific request, then you can save compilation time by swapping code out into modules. If on the other hand you need (nearly) all of your code to serve any specific request, then you win on load time by keeping the code in a single file.

Very large CGI application are quite likely to gain rather than lose performance by using a multimodule approach. Message board scripts for example are commonly spread across many files.

  • Comment on Re: CGI speed: one script versus many modules