If you want calculate the PI in your C/CGI script to several thousand places, probably yes, because of calculation speed of compiled probram is much faster.
But, If your C/CGI will output only "hello world" probably not. :)
Result: impossible to say without some benchmarks and indepth analysis what causes the slowness.
What you should do? Only IMHO :)
- replace apache with
nginx
- replace your plain CGI with PGSI based perl apllication. (if you want refactor to C you can easier refactor to Plack/PSGI
- use some small framework to get fast results
- run the final Plack APP as standalone perl/web server behing the
nginx reverse proxy
- configure
nginx to serve static files
done ;)
You can test Plack/PSGI solution in 5 min - using the Plack::Handler::CGI or with CGI::Emulate::PSGI
Again, all above is only IMHO, as you know - maybe your mileage is ... ;)