2

There may be some situations where the compilation process takes more time than the program's run time. What should one do in those circumstances?

If we consider CGI scripts where it may be called hundreds or thousands of times every minute then the above problem may occur. How to avoid these problems? We can't skip the compilation process. How to deal with such situations?

Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133

1 Answers1

9

If you are looking at Perl-based CGI scripts, consider using something like mod_perl or FastCGI, which address that exact issue (among others).

A more generic way of doing the same thing would be to build some sort of "server" application that loads once and listen for client connections. The clients can then be very small lightweight processes that just connect to the server and ask the server to perform whatever work is needed.

Adam Batkin
  • 51,711
  • 9
  • 123
  • 115