From owner-freebsd-current Mon Oct 9 16:29:38 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA28101 for current-outgoing; Mon, 9 Oct 1995 16:29:38 -0700 Received: from ibp.ibp.fr (ibp.ibp.fr [132.227.60.30]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA28096 for ; Mon, 9 Oct 1995 16:29:33 -0700 Received: from blaise.ibp.fr (blaise.ibp.fr [132.227.60.1]) by ibp.ibp.fr (8.6.12/jtpda-5.0) with ESMTP id AAA09741 for ; Tue, 10 Oct 1995 00:29:31 +0100 Received: from (uucp@localhost) by blaise.ibp.fr (8.6.12/jtpda-5.0) with UUCP id AAA05664 for freebsd-current@FreeBSD.ORG; Tue, 10 Oct 1995 00:29:30 +0100 Received: (from roberto@localhost) by keltia.freenix.fr (8.7.1/keltia-uucp-2.6) id AAA05089 for freebsd-current@FreeBSD.ORG; Tue, 10 Oct 1995 00:28:33 +0100 (MET) From: Ollivier Robert Message-Id: <199510092328.AAA05089@keltia.freenix.fr> Subject: PHK malloc against Mark Moraes malloc To: freebsd-current@FreeBSD.ORG (FreeBSD Current Users' list) Date: Tue, 10 Oct 1995 00:28:33 +0100 (MET) X-Operating-System: FreeBSD 2.2-CURRENT ctm#1193 X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@FreeBSD.ORG Precedence: bulk Here are the results of a quick test between our now standard malloc made by Poul-Henning (malloc/2), Mark Moraes' malloc (in port under devel/libmalloc) and GNU malloc: PHK malloc/2: 232 [0:16] roberto@keltia:/build/malloc> ./phkregress + time ./sim -d -t 2000 -s 1024 -l 2000 Sbrked 2744320, MaxAlloced 2023416, Wastage 0.26 0.50 real 0.28 user 0.16 sys + time ./sim -t 15000 -s 1024 -l 2000 Sbrked 2932736, MaxAlloced 2184592, Wastage 0.26 2.13 real 1.91 user 0.17 sys + time ./sim -d -t 5000 -s 512 -l 20 Sbrked 32768, MaxAlloced 22784, Wastage 0.30 0.64 real 0.61 user 0.02 sys + time ./sim -d -t 500 -s 512 -l 20 Sbrked 28672, MaxAlloced 20808, Wastage 0.27 0.12 real 0.08 user 0.02 sys + time ./sim -d -t 500 -s 512 -l 500 Sbrked 364544, MaxAlloced 265948, Wastage 0.27 0.14 real 0.11 user 0.01 sys + time ./sim -d -t 500 -s 512 -a Sbrked 688128, MaxAlloced 513592, Wastage 0.25 0.17 real 0.06 user 0.09 sys MR malloc: 233 [0:16] roberto@keltia:/build/malloc> ./mrregress + time ./simumalloc -d -t 2000 -s 1024 -l 2000 Sbrked 2246200, MaxAlloced 2023416, Wastage 0.10 0.24 real 0.07 user 0.14 sys + time ./simumalloc -t 15000 -s 1024 -l 2000 Sbrked 2516724, MaxAlloced 2184592, Wastage 0.13 0.79 real 0.62 user 0.15 sys + time ./simumalloc -d -t 5000 -s 512 -l 20 Sbrked 32776, MaxAlloced 22784, Wastage 0.30 0.21 real 0.16 user 0.03 sys + time ./simumalloc -d -t 500 -s 512 -l 20 Sbrked 28676, MaxAlloced 20808, Wastage 0.27 0.08 real 0.03 user 0.03 sys + time ./simumalloc -d -t 500 -s 512 -l 500 Sbrked 299212, MaxAlloced 265948, Wastage 0.11 0.10 real 0.05 user 0.03 sys + time ./simumalloc -d -t 500 -s 512 -a Sbrked 524656, MaxAlloced 513592, Wastage 0.02 0.11 real 0.04 user 0.05 sys GNU malloc: 238 [0:19] roberto@keltia:/build/malloc> ./gnuregress + time ./gnumalloc -d -t 2000 -s 1024 -l 2000 Sbrked 2748416, MaxAlloced 2023416, Wastage 0.26 0.88 real 0.11 user 0.15 sys + time ./gnumalloc -t 15000 -s 1024 -l 2000 Sbrked 2932736, MaxAlloced 2184592, Wastage 0.26 0.81 real 0.52 user 0.23 sys + time ./gnumalloc -d -t 5000 -s 512 -l 20 Sbrked 36864, MaxAlloced 22784, Wastage 0.38 0.32 real 0.25 user 0.02 sys + time ./gnumalloc -d -t 500 -s 512 -l 20 Sbrked 32768, MaxAlloced 20808, Wastage 0.36 0.10 real 0.04 user 0.03 sys + time ./gnumalloc -d -t 500 -s 512 -l 500 Sbrked 372736, MaxAlloced 265948, Wastage 0.29 0.11 real 0.04 user 0.04 sys + time ./gnumalloc -d -t 500 -s 512 -a Sbrked 696320, MaxAlloced 513592, Wastage 0.26 0.13 real 0.05 user 0.06 sys With this tests (the various programs are just simumalloc.c from MR malloc's distribution compiled with the various malloc), Poul-Henning's one is better on size than GNU malloc but slower (especially on the second test). Mark Moreas' one is very good BTW. Complicated with the debug code but worth to consider. Here are the result of the same test with dlmalloc (Doug Lea) found in ports in devel/libdlmalloc. It is a fast one too. The negative percentages are interesting... 247 [0:25] roberto@keltia:/build/malloc> ./dlregress + time ./dlmalloc -d -t 2000 -s 1024 -l 2000 Sbrked 2162688, MaxAlloced 2023416, Wastage 0.06 0.24 real 0.10 user 0.13 sys + time ./dlmalloc -t 15000 -s 1024 -l 2000 Sbrked 2367488, MaxAlloced 2184592, Wastage 0.08 0.72 real 0.57 user 0.13 sys + time ./dlmalloc -d -t 5000 -s 512 -l 20 Sbrked 16384, MaxAlloced 22784, Wastage -0.39 0.24 real 0.19 user 0.03 sys + time ./dlmalloc -d -t 500 -s 512 -l 20 Sbrked 16384, MaxAlloced 20808, Wastage -0.27 0.09 real 0.04 user 0.03 sys + time ./dlmalloc -d -t 500 -s 512 -l 500 Sbrked 286720, MaxAlloced 265948, Wastage 0.07 0.11 real 0.04 user 0.05 sys + time ./dlmalloc -d -t 500 -s 512 -a Sbrked 507904, MaxAlloced 513592, Wastage -0.01 0.12 real 0.02 user 0.08 sys -- Ollivier ROBERT -=- The daemon is FREE! -=- roberto@keltia.frmug.fr.net FreeBSD keltia.freenix.fr 2.2-CURRENT #2: Sat Oct 7 23:37:44 MET 1995