From owner-freebsd-hackers@FreeBSD.ORG Mon May 7 14:22:34 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AC2916A402 for ; Mon, 7 May 2007 14:22:34 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id D17EA13C455 for ; Mon, 7 May 2007 14:22:33 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: by ug-out-1314.google.com with SMTP id 71so916553ugh for ; Mon, 07 May 2007 07:22:32 -0700 (PDT) Received: by 10.82.113.6 with SMTP id l6mr10603989buc.1178547752225; Mon, 07 May 2007 07:22:32 -0700 (PDT) Received: by 10.82.148.19 with HTTP; Mon, 7 May 2007 07:22:32 -0700 (PDT) Message-ID: Date: Mon, 7 May 2007 17:22:32 +0300 From: "Vlad GALU" To: valiy In-Reply-To: <463F321A.1010803@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <463EDED0.2090805@mail.ru> <463F321A.1010803@mail.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD 6.1 6.2 C++ stl set.clear() very slow X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 14:22:34 -0000 On 5/7/07, valiy wrote: > Vlad GALU wrote: > > On 5/7/07, valiy 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.