PHP vs. C CGI for small web service -


i creating small web service accessed machines, not users takes query string , makes few mysql queries. decided code in php because simple , easy write , job well. boss however, wants write cgi in c (using fastcgi) because says faster , use less memory. i'm not keen on idea few reasons:

  • the mysql api c seems have lot more calls equivalent php , need lot more error handling.
  • string manipulation in c complicated , messy.
  • the code in c 3 times long equivalent code in php , looks rather messy, lots of error handling.

but that's opinion. other factors need take in account? c best tool job? or php?

some points this:

  • it's easier implement web service in php rather c, because php language designed work online , c general language.
  • c compiled , makes faster php programs, if worried optimization (your program consumes lot of resources , hardware limited) can use php "accelerators" compiles source (for example)
  • access databases equal penalized in both languages, if program has access lot db, have similar performance.
  • the more important: boss boss :)

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -