Home > C, Monkey, Programming > [Monkey] More performance improvements underway

[Monkey] More performance improvements underway

One thing is clear: you can improve everything!. We have been doing some cool improvements in Monkey internals, our next release will rock more than usual, 0.14.0 is very promising in terms of speed and low resources usage.

I would like to put here just a simple example, after analyzing each HTTP cycle of our server, we found a couple of parts of the architecture where some functions were not so fast as we though (that’s the problem.. we though :) ), so after put our hands on we have some results. The following new improvement case take place in one function which perform string search with string limits, let’s take a close look to the original diagram:

Diagram generated with valgrind + kcachegrind,
5000 request performed with apache benchmark (ab)

If you click in the image, you will realize that function mk_string_search_n() used to be 64.91% of parent function mk_http_init(), so there was something wrong, after analyze the code we decide to rewrite the old function and do some magic with string limits, after a while here is the result:

After rewrite mk_string_search()

So we have improved the function performance, decreasing it’s computing time from 64.91% to 7.11%, obviously this means less CPU usage + more requests per second = better performance. If you are curious, you can find the patch here.

This is not all, also we have also merged new patches to decrease memory allocation per request, better hostname matching and small internal changes… as I said.. Monkey 0.14.0 will rock!

Source
http://blog.monkey-project.com/2011/04/08/more-performance-improvements-underway/

Categories: C, Monkey, Programming Tags: