NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/50791: NetBSD's malloc has performance issues

>Number:         50791
>Category:       lib
>Synopsis:       NetBSD's malloc has performance issues
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 12 10:30:00 +0000 2016
>Originator:     Andreas Gustafsson
>Release:        NetBSD 6.1.5 and 7.0

System: NetBSD
Architecture: x86_64
Machine: amd64

I noticed that an application I'm working on was performing
significantly worse on NetBSD than on other operating systems, and
tracked down the problem to malloc/free, which were using several
times more CPU time than on the other systems for this particular


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:

  gunzip test.c.gz
  cc test.c
  time ./a.out

On an Intel Core 2 Duo CPU E8400 @3.00GHz running NetBSD 6.1.5, this
took 0.666 seconds.  On an identical machine running Debian 7, it
took 0.118 seconds, more than 5x faster.

For another data point, on an Intel Core i5 @3.3 GHz running NetBSD
7.0, it took 0.224 seconds.  On a Intel Core i5 @2.5 GHz running
Mac OS X 10.11.3, it took 0.081 seconds, more than 2.5x faster
despite the lower clock speed.


Home | Main Index | Thread Index | Old Index