This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Malloc improvements


Hi,

It's great to see the current focus on improving malloc. One thing that
would really help POWER is reducing the number of locks and atomics in
the fast path. Right now we have 3 in the malloc fastpath and 2 in
free. These add up.

The relative performance of a simple malloc/free of 8 bytes on POWER8
shows just how much can be gained by having a lockless fast path:

glibc baseline  466%
dj/malloc       518%
jemalloc        147%
tcmalloc        100%

Anton
--

#include <malloc.h>

#define ITERATIONS 100000000

void *x;
int main(void)
{
	unsigned long i;

	for (i = 0; i < ITERATIONS; i++) {
		x = malloc(8);
		free(x);
	}
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]