[wsf-c-dev] Performance :(

Samisa Abeysinghe samisa at wso2.com
Sun Dec 17 21:58:07 PST 2006


James Clark wrote:
> On Fri, 2006-12-15 at 11:45 +0530, Damitha Kumarage wrote:
>   
>> Hi
>>
>>     
>>> I did some performance tests using the similar scenario that the Java 
>>> guys are using with ADB using the test machines.
>>>
>>> Looks like the C service using generated code with ADB deployed with 
>>> httpd is 15 to 20 times *slower* than Java implementation running with 
>>> tomcat:(
>>>       
>> There are are lot of things we can do to immediately increase the 
>> performance. For example we call AXIS2_PARAM_CHECK
>> unneccessarily in the code. My suggestion is that we should completely 
>> get rid of this and do the param check as appropriately in the 
>> appropriate places. This will prevent blind use of this macro. Also we 
>> should avoid using AXIS2_ENV_CHECK everywhere. There are thousands of 
>> calls on these functions which I think is an unneccesry overhead.
>> Also I believe that removing obvious places where we can get rid of ops 
>> structs also will increase the performance significantly. This will also 
>> eliminate the profiling problems that samisa indicated due to 
>> indirection with ops struct.
>>
>> We should not think problems like above mentioned are serious things. 
>> When we did the implementation I believe we did it as a first iteration. 
>> I personally did not think it as a cemeneted code that would not allow 
>> us for any change in the future.
>> So let's do these obvious and see.
>>     
>
> Randomly trying changes and seeing if they help is not the way to do
> things.  The right way is to do some profiling with different tools and
> different inputs so that you KNOW what the problem is.  Then fix it.
>   
I did a test over the weekend, where I profiled two programs 
implementing the identical logic accessing an array list, one using ops 
struct and other using functions. What I noticed is that, the percentage 
time the ops program spends in the function calling the indirect 
operations is greater than the percentage time the other program spends 
in the function with same logic but function calls. The program with ops 
struct spent about 4% more.
So there may be a hit there, but more through testing is required before 
coming to a conclusion, which I would do after this release week.

In the mean time, I was trying to profile simple axis server with 
callgrind over the weekend for the performance testing service.
There are various view to look at this, more time is required to 
understand the real implications. I would spend some time on this after 
this release week.
I have given here the call graph for 100 and 500 requests.
http://tools.wso2.net/~samisa/cg-100.png
http://tools.wso2.net/~samisa/cg-500.png
As we can notice, more time is spent in serializing with more requests.

Also, at a very high level, looking at the self times, I see that we 
spend the greatest time managing memory, we also have hash computation 
taking a considerable time.  Then third in line are the string handling 
functions (strstr, strlen etc.). Then we get some libxml2 functions 
followed by AXIOM related functions.

Samisa...






More information about the Wsf-c-dev mailing list