Main BLOGGER
Google
WWW THIS BLOG
Monday, March 13, 2006
 
ACE_String && performance issue

String allocation/deallocation is a primary cause of heap fragmentation and poor performance.

 

There are three things that we can do to speed up string usage.

 

1.

const SymString fname="my func";

should be .. static const SymChar fname[]=SymText("my func");

 

SymString will allocate memory for "my func" and copy it every time the function is entered.

 

2.

SymString myString = "x";

if (myString == "x") do something;

should be .. if (ACE_OS::strcmp(myString, "x") == 0) do something;

 

SymString doesn't implement the operator== for a char *. Instead it will copy "x" into another SymString, do the compare and then free it.

 

Can we add such operator== for char* into ACE_String, so we don't need to look it thru our code? ----------Michael.

3.

SymString myGetFn()

{

    return m_value;

}

 

should be

const SymString & myGetFn() const

{

    return m_value;

}

 

Always return a const reference in a Get fn. It is also a good idea to declare the Get fn as const.

 

 

General conclusions:
1. We need task chunking in SDK. - SDK and SSM are both idling waiting for requests.
2. We need to improve the SSM's bind/unbind decision making - when task throughput is slow, it makes it slower.
3. The SSM's critical code path for task acceptance is very efficient.
4. The SDK's code path for task sending may be optimized a bit - it's 4 times slower than the SSM. I couldn't get quantify to run on the SDK.
5. A small improvement can be made in marshalling/communications by putting call objects and message blocks into an object pool.

 

- Ajith

 




<< Home

Powered by Blogger

Google
WWW THIS BLOG