perl malloc slow?

Holger Kipp Holger.Kipp at
Tue Jan 6 07:36:58 PST 2004

Alexander Leidinger (Alexander at wrote: 
>On Tue, 06 Jan 2004 11:29:05 +0000
>Holger Kipp <Holger.Kipp at> wrote:
>> Searching on the internet gave the impression that this might be
>> malloc/FreeBSD related. Any chance of this being resolved?
>Use perls own malloc implementation (make -DWITHOUT_PERL_MALLOC for an
>up-to-date perl5.8 port, if you use make -DWITH_THREADS perls own malloc
>implementation gets disabled by the FreeBSD port)? AFAIK perl 5.0 in the
>4.x basesystem doesn't use its own malloc implementation.

Upgraded Perl 5.8.0 to 5.8.2 which has these switches set already, so I 
guess the problem is well-known.

Kris Kennaway wrote: "For any algorithm one can come up with a workload that
  makes it perform badly.  The trick is making it perform well for
  common workloads, which FreeBSD's malloc does."

Even so, if Perl malloc and Linux malloc are O(n) with a small constant and
FreeBSD malloc behaves like O(n*n) or worse with a large constant in this
easy example (of a real-world applikation), this behaviour should imho be

See also


More information about the freebsd-current mailing list