Home  /  RSS  /  RSS Comments  /  Enter

CppCMS vs WordPress

Monday, June 9, 2008, by artyom ; Posted in: Benchmarks, Framework, Cache; 7 comments

Setup

I had compared two blog systems: this one and WordPress 2.5 with a patched WP-Cache-2 addon. I used following configuration:

  1. Web Server lighttpd 1.4.13
  2. Interface FastCGI
  3. PHP 5.2
  4. Bytecode cacher: XCache 1.2.1
  5. Database MySQL 5.0
  6. Caching for WP: WP-Cache-2 with an additional performance patch
  7. Hardware: AMD Athlon XP 64bit, 1G RAM
  8. OS: Linux, Debian Etch 64bit.

I prepared two blogs that were filled up with 1000 articles each. Each article had 10 comments, all the articles were organized in 10 categories in each blog.

Tests

First I run load tests with disabled caching system.

Then the cache was enabled and cleaned before each test run. Each time, the cache was "warmed up" with 100 requests of different pages. Then CMS was loaded by http_load with 1000 requests from 5 concurrent connection. The client was patched in order to send a header: Accept-Encoding: gzip, deflate in order to fetch compressed pages: the real live situation.

For each run, the cache included a certain percent of new pages (in order to achieve a correct hit/miss ratio) and the rest where taken from the 100 "warm pages".

Results

CMSNo cache fetches per second ratioWarm up time
WordPress: 7.613.0 s
CppCMS: 3100.28 s
Miss ratio (%) WordPress CppCMS
07112300
13702160
31761940
51181790
10641450
15411210
20331075
3020795
4013570
5013570
Results

Conclusions

The caching system, significantly improves both CMS written in PHP and C++. However, when hit/miss ratio grows to few percents, the performance of the CMS written in PHP drops very fast and at 3% miss ratio the difference between CppCMS and WP becomes the difference of more then 10 times.

The CppCMS system holds lower hit/miss ratio much better then WordPress with WP-Cache-2.

Comments

Alexander Higgins, at 8/3/08 12:36 PM

You are running a high-level programming language against a low level programming language. Honestly I don't think there is going to be any comparison in performance. It's like comparing Visual Basic to C++ or PHP to Perl. The higher level languages are really just a more user friendly wrapper or technology specific implementation of the lower level language. Do you really think there is going to be any comparison in performance??

artyom, at 8/3/08 12:51 PM

You are running a high-level programming language against a low level programming language

First of all, C++ is high level language. It is not dynamic typed like PHP/Perl/Python and does not have GC but it is very sophisticated and powerful.

It is not as safe as C#/VB/Java it requires better programming skills but, once you know it, the development speed will not be much lower than any "higher" level languages.

The major difference between C++ and Java/C# is actually JIT and GC, in all other terms modern C++ is very similar to it.

As and additional point of this project, I do sacrifice some "easiness" of development in order to get better performance.

So as you can see, there is a difference and huge. However I still want to do a comparison to JIT powered language.

Alexander Higgins, at 8/3/08 3:31 PM

You can write assembler inline code, C++ compiles directly into native code that can can run on just about any hardware with out the need to rely on a slew of dll's. That makes it low level to me, even if it doesn't fit the standard definition of low level.

VB.NET/PHP/C# are high level becuase the get compiled and require an interpreter to handle their functions. PHP relies on Perl. VB.Net and C# are first compiled into MSIL then into machine code and there is c++ involved in the process.

VB.NET/PHP/C# really don't have their own data types. The DataTypes are marshalled wrappers of their lower level language(Perl or C++)

So C++ may not fit the the definition of a "low level language", but its lower on the food chain than C# / VB. Perl is lower on the food chain than PHP. I am Asp.Net programming so from my context/perspective they C++ is a low level language to me.

There is more to the differences between C++ and the PHP/C# than just JIT and GC, (btw both of which reduce performance) C++ like C allows you access the method calls of the operating system directly, and as I said write inline Assembly code. For Example, every call to open a socket in C# has the overhead of A) the managed code of the frameworks its built on and B) the martially of that call to the original Operating System's native Method. In C/C++ you can access those methods directory(at your own risk).

Why don't you write a program in PHP and C++ that simply makes a connection to a remote message and sends the phase "hello". You'll probably see the the C++ application out performs a PHP or C# Application in ration similar to Cpp CMS compared to Word Press. Why, because you have no overhead. Any knowledgeable programmer know that.

Further, how many third party extensions are you running in you application. Probably ZERO. WordPress and BlogEngine.Net have "Wild" code in the form of third party Plugins on top of their nature over head. Also, why doesn't your benchmark include calls to a "control" like a static page. I would also like to see the results of a PHP page and ASP.NET doing a simply echo of the all of the server variables and your CppCMS doing the same. This would at least help to reinforce the argument that its your "application" that is superior and not the language that it's built on.

And my point is, you should be comparing you application to similar Perl or Python applications. You could have a crappy application in c++ and is probably going to run much better than a well written PHP/C# application. Don't boast about how how much better you application performs than a PHP or Asp.NET language.

Also, I hope this page isn't built on top of your CMS, becuase its the slowest page I have been on since I used dialup 10 years ago..

artyom, at 8/3/08 3:52 PM

Also, I hope this page isn’t built on top of your CMS, becuase its the slowest page I have been on since I used dialup 10 years ago..

It is :-), but the actual problem is that it running from home PC on home quite limited connection. BTW it is still much faster then any WordPress or other system.

BTW: What is the country you are working from --- maybe the round trip is mater --- for me it works very fast.

So C++ may not fit the the definition of a "low level language", but its lower on the food chain than C# / VB.

Yes, C++ is low and high language as well. That gives an ability to write productively high performance/low resources application

You could have a crappy application in c++ and is probably going to run much better than a well written PHP/C# application. Don’t boast about how how much better you application performs than a PHP or Asp.NET language.

That is the point of this project --- create a good and productive environment to write web applications in C++.

I do not expect from developer to open sockets... even it can.

BTW: this is not CMS it is C++ Web development framework --- more like Django or ASP.Net.

CppCMS Blog, at 10/16/10 5:18 PM

CppCMS benchmarks vs Java, C#, PHP

Long time ago I had posted a benchmarks comparing CppCMS based blog and PHP based one.

I wanted to compare real life applications with each other. For a long time I had been searching for similar applications in several technologies doing very similar

Legacy Modernization, at 2/1/11 7:02 PM

A lot of CMS are running on PHP these days. Must be a plus on learning the language.

Ashish, at 3/18/12 10:27 PM

Great project artyom, I'm also developing JSP like web server based on C++. I am sure about that C++ is the future web develop.

Add Comment:

 
 the email would not displayed
 

You can write your messages using Markdown syntax.

You must enable JavaScript in order to post comments.

Pages

Categories