NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/50791: NetBSD's malloc has performance issues
The following reply was made to PR lib/50791; it has been noted by GNATS.
From: Onno van der Linden <o.vd.linden%quicknet.nl@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: lib/50791: NetBSD's malloc has performance issues
Date: Fri, 12 Feb 2016 18:17:20 +0100
> I have prepared a test program that performs a sequence of 100226
> mallocs and frees, derived from a trace of the actual malloc/free
> calls made by the application. To run it:
On my machine:
NetBSD sheep 7.99.25 NetBSD 7.99.25 (SHEEP) #9: Sun Jan 3 09:04:37 MET 2016 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
$ cc mtest.c
$ time ./a.out
1.35s real 1.28s user 0.02s system
$ time ./a.out
1.30s real 1.29s user 0.01s system
$ time ./a.out
1.30s real
$ cc mtest.c -lbsdmalloc
$ time ./a.out
0.09s real 0.02s user 0.06s system
$ time ./a.out
0.09s real 0.03s user 0.06s system
Then I grabbed and installed the latest jemalloc from github
(https://github.com/jemalloc/jemalloc/archive/dev.zip)
$ cc mtest.c -Wl,-R/usr/local/lib -L/usr/local/lib -ljemalloc
$ time ./a.out
0.14s real 0.08s user 0.05s system
$ time ./a.out
0.14s real 0.09s user 0.06s system
Then I grabbed and installed jemalloc 4.0.4
$ cc mtest.c -L/usr/local/lib -Wl,-R/usr/local/lib -ljemalloc
$ time ./a.out
0.14s real 0.10s user 0.03s system
$ time ./a.out
0.13s real 0.08s user 0.05s system
Looks like NetBSD's jemalloc could use an upgrade
to 4.0.4.
Regards,
Onno
Home |
Main Index |
Thread Index |
Old Index