Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Sep 2003 15:00:17 +0800
From:      Yusuf Goolamabbas <yusufg@outblaze.com>
To:        freebsd-hackers@freebsd.org
Subject:   Perl 5.8.1-RC4 release notes mention FreeBSD malloc upto 200 times slower than perl malloc
Message-ID:  <20030909070017.GA19395@outblaze.com>

next in thread | raw e-mail | index | archive | help
In the Perl 5.8.1-RC4 release notes posted here

http://dev.perl.org/perl5/news/2003/perl-5.8.1-RC4.html

it mentions about the Platform specific problems seen by the Perl
development team. 
----------------------------------------------------------------------
FreeBSD: malloc dilemma

The choice of malloc (the C-level memory management interface) when
building Perl is problematic in FreeBSD.

Using FreeBSD's system malloc for Perl was found to be very slow: in
some cases that was 200 times slower than using the Perl malloc. One
such case is file input: for example

# slurping the whole compressed Perl source code into $a
if (open F,"perl-5.8.1.tar.gz") { local $/; $a=<F> }

is about 200-250 times slower with the system malloc than with the Perl
malloc.

One could use Perl's malloc (Configure -Dusemymalloc), but that was
found to cause random core dumps in FreeBSD with multithreaded programs.
No such problems were found in other platforms, however.

A decision was made to stick with the system malloc, regardless of the
performance problems.
----------------------------------------------------------------------

Maybe the test case can assist FreeBSD kernel hackers to make malloc
faster.

Regards, Yusuf



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