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: Andreas Gustafsson <gson%gson.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: joerg%NetBSD.org@localhost, christos%NetBSD.org@localhost
Subject: Re: lib/50791: NetBSD's malloc has performance issues
Date: Thu, 2 May 2019 17:05:41 +0300

 Here's an updated test case that eliminates slow compiler warnings
 and returns a meaningful exit status (the timeout value may have to
 be adjusted depending on the speed of the machine):
 
   ftp http://www.gson.org/netbsd/bugs/malloc-perf/test2.c.gz && gunzip test2.c.gz && cc test2.c && time ./a.out && timeout 0.15 ./a.out
 
 I ran an automated bisection using this to find out when malloc
 unexpectedly got fast.  It was this commit:
 
   2016.04.12.18.07.08 joerg src/lib/libc/stdlib/jemalloc.c 1.40
 
   lib/50791: Instead of using sorting the arena chunks by address only,
   sort by size of the longest run and address as tie break. Avoids long
   linear searches for code heavy on medium sized allocations.
 
 which unfortunately did not get recorded in the PR at the time.
 
 In an email to netbsd-bugs which also did not get recorded in the PR,
 christos said:
 
 > This is expected because of -DJEMALLOC_DEBUG
 
 I will recheck the performance once that is turned off, and close the
 PR if it's back to where it was between joerg's commit and the jemalloc
 update.
 -- 
 Andreas Gustafsson, gson%gson.org@localhost
 


Home | Main Index | Thread Index | Old Index