[MPICH2-dev] store less, allocate faster

David Gingold david.gingold at sicortex.com
Tue Nov 29 09:42:38 CST 2005


Here's a simple, if small, performance suggestion:

In MPIU_Handle_obj_alloc(), the code below seems to have a needless  
store to ptr->next:

   if (objmem->avail) {
	ptr	      = objmem->avail;
	objmem->avail = objmem->avail->next;
	ptr->next     = 0;

	/* ptr points to object to allocate */
     }

The callers shouldn't depend on that being zeroed, right?

For a bigger performance gain, you might transform the routine so  
that just this bit of code is inlined in the caller, avoiding the  
function call most of the time.

-dg






More information about the mpich2-dev mailing list