Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jan 2004 11:29:05 +0000
From:      Holger Kipp <Holger.Kipp@alogis.com>
To:        stable@freebsd.org
Cc:        current@freebsd.org
Subject:   perl malloc slow?
Message-ID:  <200401061129.i06BTAY75957@alogis.com>

next in thread | raw e-mail | index | archive | help
Happy new year to all!

I experience an interesting Problem with perl (both 5.0 and 5.8.0) and
Compress::Zlib::memGunzip on FreeBSD 4.9-STABLE (Oct. 28th 2003):

Uncompressing a larger ascii-file (200-300kB compressed, 20-40MB
uncompressed) in memory takes a ___long____ time (the larger the
uncompressed file, the more time it takes per extracted MB):

uncompressed size
 5 MB   => ca.   25 seconds  ( 5 seconds/MB)
40 MB   => ca. 1200 seconds  (30 seconds/MB)

gunzip only needs slightly more than 1 second for the 40MB file.
I don't have this problem with SuSE Linux 8.1 where extraction
with memGunzip only needs about 1.5 seconds and with gunzip
around 0.5 seconds (Linux is on a faster system).

I am not sure if this problem still exists with CURRENT.

Searching on the internet gave the impression that this might be
malloc/FreeBSD related. Any chance of this being resolved?

Regards,
Holger Kipp

Example perl program:

--- 8< -------------------------------------------------------
  use Compress::Zlib;
  use Time::HiRes qw(gettimeofday tv_interval) ;

  my $start = [ gettimeofday ] ;

  my $file = shift ;
  open FILE, "<$file" || die "Cannot open file $file: $!\n" ;
  undef $/ ;
  my $in = <FILE>;
  close FILE ;

  my $out = Compress::Zlib::memGunzip($in);

  die "undefined\n" if ! defined $out ;

  open FILE, ">$file.tmp" || die "Cannot open file $file: $!\n" ;
  print FILE $out;

  my $elapsed = tv_interval ( $start, [gettimeofday]);

  print "elapsed time is $elapsed\n" ;
--- 8< -------------------------------------------------------



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