What a coincidence! Lovely topic, even registered account for this :-)<p>I _just_finished_ my own comparative benchmarks to (re)check my projects from ~7 years ago, all in similar stack.<p>Back then I wrote the logic as Apache modules, in C. It was using Cairo to draw charts (surprisingly, the traces of trigonometry knowledge was enough for me to code that :-), and I had absolutely crazy "hybrids" of bubble charts with bars, alpha channel overlays etc. It was extremely useful for my projects back then and I never seen any library, able to produce what I "tailored" ...)<p>The 7-years-ago end-to-end page generation time was ~300 mcs (1e-6 sec), with graphics, data store IO and request processing, preparing the "bucket brigade" and passing it down the Apache chain.<p>This Jan I re-visited my code and implemented logic for OpenBSD httpd as:<p>** 1) Open BSD httpd "patch" to hijack the request processing internally, do necessary data and graph ops and push the result into Bufferevent buffer directly, before httpd serves it up to the client.<p>** 2) FCGI responder app, talking to httpd over unix socket. <i>BTW</i>: this is <i>most</i> secure version I know of, I could chroot / pledge / unveil and, IMO, it beats SELinux and anything else.<p>3) CGI script in ksh<=>slowcgi<=>FCGI=>httpd<p>4) CGI program (statically linked) in pure C<=>slowcgi<=>FCGI=>httpd<p>5) PHP :-) page (no frameworks)<=>php-fpm (with OpCache)<=>FCGI=>httpd<p>To my extreme surprise, the outcome was clear - <i>it did not matter</i> what I wrote my logic in, _anything today_ (including CGI shell script) is so fast, that 90% of time was spent on Network communication between the WebServer and the Browser. (And with TLS it is like 2x penalty ...)<p>All options above gave me end-to-end page generation time about 1-1.5 ms.<p>Guess what? Beyond "Hello World", with page size of 500Kb+, PHP was faster than anything else, including native "httpd patch" in C.<p>As side effect, I also confirmed that Libevent-based absolutely gorgeous OpenBSD httpd works slightly slower than standard pre-fork Apache httpd from pkg_add. (It gave me sub-ms times, just like 7 years ago)<p>Who would say ...<p>What also happened is that <i>any</i> framework (PHP or I even tried nodejs) or writing CGI in Python increased my end-to-end page generation time 10x, to double-digit ms.<p>I remember last week someone here was talking about writing business applications / servers for clients in C++, delivering them as single executable file.<p>I would be very interested to hear how that person's observations correlate with mine above.<p>G'day everyone!