1

Im thinking in refactor my application migrating my Perl CGI to a C++ CGI.

I'm trying to improve performance, because we need more runtime speed procesing.

Taking into account that mod_perl compile once at startup the Perl CGI:

Is it possible getting better performance using a C/C++ CGI? (in this case over FastCGI)

It have sense?

1 Answer 1

4

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 ... ;)

Sign up to request clarification or add additional context in comments.

1 Comment

@moalaiskirulais while i'm happy with the accept, you should wait a bit longer, maybe someone other will give a better answer ;) :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.