nedmalloc, again
Re: nedmalloc, again
Mmmm, weirdness, recompiled today and it now runs. Doesn't give to much trust in nedmalloc :). "nedmalloc allocator is 1.402341 times faster than standard". Now time to plug in my own malloc...
JAL
JAL
Re: nedmalloc, again
Yeah, sorry, no results yet, been busy with other stuff. Maybe next week. Anyone else has any results?
JAL
JAL
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: nedmalloc, again
I could plug PDClib's malloc, but knowing it is an inefficient alpha version it is guaranteed to lose big time. So I didn't bother.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: nedmalloc, again
I'm working on my libc's malloc this week - I'll test it if I finish soon enough: it should work really well on lots of similar allocations. Where is the code for nedmalloc's benchmark suite?
Re: nedmalloc, again
In the nedmalloc zip-file. It's just one Google away.NickJohnson wrote:Where is the code for nedmalloc's benchmark suite?
JAL
Re: nedmalloc, again
Something's wrong here. I cannot compile test.c on Ubuntu x64
"Programmers are tools for converting caffeine into code."
Re: nedmalloc, again
What errors do you get?quanganht wrote:Something's wrong here. I cannot compile test.c on Ubuntu x64
JAL
Re: nedmalloc, again
Like thisjal wrote:What errors do you get?quanganht wrote:Something's wrong here. I cannot compile test.c on Ubuntu x64
JAL
Code: Select all
In file included from nedmalloc.c:63,
from test.c:8:
malloc.c.h: In function ‘mmap_resize’:
malloc.c.h:3704: warning: cast to pointer from integer of different size
malloc.c.h: In function ‘sys_trim’:
malloc.c.h:4137: warning: comparison between pointer and integer
/tmp/cc3lTAIT.o: In function `AllocCache':
test.c:(.text+0x8ad7): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `InitPool':
test.c:(.text+0x913a): undefined reference to `pthread_key_create'
test.c:(.text+0x9293): undefined reference to `pthread_key_delete'
/tmp/cc3lTAIT.o: In function `FindMSpace':
test.c:(.text+0x9acd): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `neddestroypool':
test.c:(.text+0x9d1b): undefined reference to `pthread_key_delete'
/tmp/cc3lTAIT.o: In function `neddisablethreadcache':
test.c:(.text+0x9f49): undefined reference to `pthread_getspecific'
test.c:(.text+0x9f6a): undefined reference to `pthread_setspecific'
test.c:(.text+0xa0d3): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpmalloc':
test.c:(.text+0xa21d): undefined reference to `pthread_getspecific'
test.c:(.text+0xa29c): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpcalloc':
test.c:(.text+0xa62d): undefined reference to `pthread_getspecific'
test.c:(.text+0xa6ac): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedprealloc':
test.c:(.text+0xaa52): undefined reference to `pthread_getspecific'
test.c:(.text+0xaad1): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpfree':
test.c:(.text+0xacd3): undefined reference to `pthread_getspecific'
test.c:(.text+0xad52): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpmemalign':
test.c:(.text+0xaedc): undefined reference to `pthread_getspecific'
test.c:(.text+0xaf5b): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpindependent_calloc':
test.c:(.text+0xb604): undefined reference to `pthread_getspecific'
test.c:(.text+0xb683): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `nedpindependent_comalloc':
test.c:(.text+0xba70): undefined reference to `pthread_getspecific'
test.c:(.text+0xbaef): undefined reference to `pthread_setspecific'
/tmp/cc3lTAIT.o: In function `runtest':
test.c:(.text+0xc287): undefined reference to `pthread_create'
test.c:(.text+0xc304): undefined reference to `pthread_join'
test.c:(.text+0xc343): undefined reference to `pthread_create'
test.c:(.text+0xc388): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
"Programmers are tools for converting caffeine into code."
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: nedmalloc, again
That is not a compilation error.
Ever tried linking to the correct libraries? (read: -lpthread)
Ever tried linking to the correct libraries? (read: -lpthread)
Re: nedmalloc, again
Got it. 10 threads under Ubuntu 9.10 running x86-64 Core 2 Duo. This is what I have
WTF is it anyway ?!? Linux malloc out performed ned's ?
EDIT: With 5 threads:
EDIT2: I think I have gone mad to do this:
The nedmalloc has a huge delay before it fire up, especially with more and more threads.
Code: Select all
nedmalloc allocator is 0.508529 times faster than standard
EDIT: With 5 threads:
Code: Select all
nedmalloc allocator is 0.711086 times faster than standard
Code: Select all
20 threads:
nedmalloc allocator is 0.316950 times faster than standard
50 threads:
nedmalloc allocator is 0.171097 times faster than standard
100 threads:
nedmalloc allocator is 0.091263 times faster than standard
100 threads with -O3:
nedmalloc allocator is 0.076826 times faster than standard
"Programmers are tools for converting caffeine into code."
Re: nedmalloc, again
Or just plain -pthread.Combuster wrote:(read: -lpthread)
JAL
-
- Member
- Posts: 391
- Joined: Wed Jul 25, 2007 8:45 am
- Libera.chat IRC: aejsmith
- Location: London, UK
- Contact:
Re: nedmalloc, again
In testing against my allocator I found that the latest released version of nedmalloc performs pretty badly. After switching to nedmalloc SVN (revision 1130 - latest was broken for me), it started performing much better.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: nedmalloc, again
I finally finished my allocator, and ported it to Linux. It's only single threaded, so all of these tests are with only 1 thread. It's all with "-O2 -fomit-frame-pointer -march=native" under gcc 4.3.4 and glibc 2.3.7. (glibc was compiled with "-O2 -fomit-frame-pointer -march=native" for fairness)
I changed the output format for the benchmark to just output the speed of each allocator, so I could compare them all at once. Here are the results:
Clearly, for single threads, nedmalloc > abmalloc (my malloc) > glibc's malloc, although it seems like nedmalloc scales badly from other results. If I set it to not allocate the larger blocks, and only the power-of-2 <512 byte chunks it says are typical of C++ allocations, the results are quite different:
I specifically designed my allocator for small allocations, so it isn't very surprising that it's twice as fast as glibc's malloc for them.
Does anyone else have results?
I changed the output format for the benchmark to just output the speed of each allocator, so I could compare them all at once. Here are the results:
Code: Select all
standard: 1960572 ops/sec
nedmalloc: 2784614 ops/sec
abmalloc: 2329786 ops/sec
Code: Select all
standard: 2245848 ops/sec
nedmalloc: 3269323 ops/sec
abmalloc: 4247631 ops/sec
Does anyone else have results?