Date: Mon, 7 May 2007 17:22:32 +0300 From: "Vlad GALU" <dudu@dudu.ro> To: valiy <valiy-td@mail.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD 6.1 6.2 C++ stl set.clear() very slow Message-ID: <ad79ad6b0705070722r16d450f9n8b53e1fd3e80e044@mail.gmail.com> In-Reply-To: <463F321A.1010803@mail.ru> References: <463EDED0.2090805@mail.ru> <ad79ad6b0705070119k35c6adb6scfdf94192aafff07@mail.gmail.com> <463F321A.1010803@mail.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5/7/07, valiy <valiy-td@mail.ru> wrote: > Vlad GALU wrote: > > On 5/7/07, valiy <valiy-td@mail.ru> wrote: > > [...] > > It might be related to phkmalloc vs jemalloc. You may want to try > > to link against jemalloc to see if the slowdown still occurs. > > > http://lists.freebsd.org/pipermail/freebsd-stable/2006-October/029186.html > Fetch the HEAD revision of http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/tree.h and overwrite your existing file using it. Afterwards, fetch the HEAD revision of http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/malloc.c. Last step: gcc -fPIC -O -Wall -I/usr/src/lib/libc/include -I/usr/src/sys -shared -o malloc.so malloc.c Or if you want to compile it into a simple object that you can then link directly in your application, gcc -O -Wall -I/usr/src/lib/libc/include -I/usr/src/sys -o malloc.o malloc.c HTH. > > [root@valiy ~]# cp /7.0_CURRENT/src/lib/libc/stdlib/malloc.c > /tmp/jemalloc.so > [root@valiy ~]# gcc -O -Wall -I/usr/src/lib/libc/include -shared -o > /lib/jemalloc.so /tmp/jemalloc.c > /tmp/jemalloc.c:1197: warning: type defaults to `int' in declaration of > `RB_GENERATE_STATIC' > /tmp/jemalloc.c:1197: warning: parameter names (without types) in > function declaration > /tmp/jemalloc.c:1197: warning: data definition has no type or storage class > /tmp/jemalloc.c: In function `chunk_alloc': > /tmp/jemalloc.c:1267: warning: implicit declaration of function > `chunk_tree_s_RB_MINMAX' > /tmp/jemalloc.c:1267: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c:1273: warning: implicit declaration of function > `chunk_tree_s_RB_NEXT' > /tmp/jemalloc.c:1273: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c:1276: warning: implicit declaration of function > `chunk_tree_s_RB_REMOVE' > /tmp/jemalloc.c: In function `chunk_dealloc': > /tmp/jemalloc.c:1444: warning: implicit declaration of function > `chunk_tree_s_RB_FIND' > /tmp/jemalloc.c:1444: warning: comparison between pointer and integer > /tmp/jemalloc.c:1451: warning: implicit declaration of function > `chunk_tree_s_RB_INSERT' > /tmp/jemalloc.c: At top level: > /tmp/jemalloc.c:1597: warning: type defaults to `int' in declaration of > `RB_GENERATE_STATIC' > /tmp/jemalloc.c:1597: warning: parameter names (without types) in > function declaration > /tmp/jemalloc.c:1597: warning: data definition has no type or storage class > /tmp/jemalloc.c: In function `arena_chunk_alloc': > /tmp/jemalloc.c:1794: warning: implicit declaration of function > `arena_chunk_tree_s_RB_INSERT' > /tmp/jemalloc.c: In function `arena_chunk_dealloc': > /tmp/jemalloc.c:1875: warning: implicit declaration of function > `arena_chunk_tree_s_RB_REMOVE' > /tmp/jemalloc.c: In function `arena_run_alloc': > /tmp/jemalloc.c:2051: warning: implicit declaration of function > `arena_chunk_tree_s_RB_MINMAX' > /tmp/jemalloc.c:2051: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c:2051: warning: implicit declaration of function > `arena_chunk_tree_s_RB_NEXT' > /tmp/jemalloc.c:2051: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c: In function `huge_dalloc': > /tmp/jemalloc.c:2730: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c: In function `isalloc': > /tmp/jemalloc.c:2944: warning: assignment makes pointer from integer > without a cast > /tmp/jemalloc.c: In function `malloc_init_hard': > /tmp/jemalloc.c:3114: warning: 'opts' might be used uninitialized in > this function > /tmp/jemalloc.c: In function `calloc': > /tmp/jemalloc.c:3559: warning: 'num_size' might be used uninitialized in > this function > /tmp/jemalloc.c: At top level: > /tmp/jemalloc.c:1183: warning: 'chunk_comp' defined but not used > /tmp/jemalloc.c:1583: warning: 'arena_chunk_comp' defined but not used > > > could you please send me you version of malloc.c ? > -- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ad79ad6b0705070722r16d450f9n8b53e1fd3e80e044>