Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 1995 00:28:33 +0100 (MET)
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        freebsd-current@FreeBSD.ORG (FreeBSD Current Users' list)
Subject:   PHK malloc against Mark Moraes malloc
Message-ID:  <199510092328.AAA05089@keltia.freenix.fr>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510092328.AAA05089>