Search for webapp speed

If I want real speed for a web application. What webserver/language should I use?
This is a question I've been asking myself lately, and I found that there is no real good solution currently available.
Sure, PHP/ASP/JSP/Whatever with MySQL/SQLite/OtherDB would probably work in most cases, but I would like to have some real powerful kick ass speed.
What I would like to have is C++ used like a scripting language, and I've been thinking that this can't be that impossible. Can it?

What I would like to have:
  • A webserver that compiles the C++-files when accessed just like a scripting language. It should check for file-changes and compile when appropriate.
  • The abillity to create in memory "application"-objects that also can run things in threads. What I mean is that if I for instance create the "application" "http://myserver/forum", there could be some "void main()" in the "forum"-folder that is executed when the webserver starts. This "void main()" could then create threads or do whatever it would like in the background. If C++-files would change related to the "application", then it should run the applications appropriate destructors, recompile, and start the "application" again.
  • Preferably it should be build using MVC.
  • Everything should be build using a object oriented interface. Communication between "pages" and the "application" and the webserver should all be done using pure virtual interfaces plugins just like we do in mC2 . This would make everything alot more clean.

If something like this existed you would be able to build some really powerful webapps. Caching the most important objects in the "application"-part, and accessing the rest from the database.
Sure, the developer would still be responsible for not overloading memory in the "application"-part, but C++-developers are used to this. It would probably help with some kind of help-library that implements caching-vectors that removes objects that are rarely used in the "application"

so, am I the only one that's been thinking like this or is my googling just bad?


  1. You are not the only one thinking about it. The problem is that c++, and any other "speedy" language, makes development slower. In many cases it's just simpler and cheaper to add another server instead of using a more efficient language.
    Furthermore many would like to import, with c++, also the "desktop paradigm" in web development, and this simply cannot work.

    On the other hand the more trafficked your website become the more efficience you need. So there is something that you can use for your needs, but not easily and nothing do exactly what you ask for.

    I have done some research for my own needs and I found these.
    1) Facebook HipHop for PHP: HipHop transforms your PHP source code into highly optimized C++ and then compiles it with g++ to build binary files. You keep coding in simpler PHP, then HipHop executes your source code in a semantically equivalent manner and sacrifices some rarely used features – such as eval() – in exchange for improved performance.
    If you find a good php mvc framework, you could have the best of both worlds. Personally I never used it and I don't think it would be easy to manage.
    2) OKWS, used at Okcupid.com: OKWS is a Web server, specialized for building fast and secure Web services. They use it to build a web application in c++, but as the authors themselves say: Unless you’re making a website that’s to be computationally intensive and high-trafficked, we recommend something else.
    3) CppCMS - C++ Web Development Framework. It uses MVC and it's still early in development, but it's the only c++ framework that I heard of.

    It's not exactly what you ask for, but combining them you can achieve something useful.

  2. Good comments mente, and some really nice links.
    I've looked at hiphop some weeks ago and seems like a nice idea.

    CppCMS looks like a really good project that I will investigate further.

  3. In web-applications kickass speed is not the matter of programming language, but performance of disk and DB access in most cases.

    That's why kickass speed is usually gained by paralleling execution (see Google MapReduce) and data access across several computing units.

    I would use Python or Stackless with gevent. But if I really mean speed - I'd forget about C++ and try Go. You don't write mC2 in assembly - why would you use C++ for webapp? C++ is insecure, requires a lot of expertise from developer's side, doesn't parallelize easily and doesn't scale.

    For Go webapps there is even a tutorial.