From owner-freebsd-current@FreeBSD.ORG Tue Jan 6 03:29:15 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EF3F16A4CE; Tue, 6 Jan 2004 03:29:15 -0800 (PST) Received: from alogis.com (firewall.solit-ag.de [212.184.102.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C78A243D49; Tue, 6 Jan 2004 03:29:12 -0800 (PST) (envelope-from Holger.Kipp@alogis.com) Received: from intserv.int1.b.intern (localhost [127.0.0.1]) by alogis.com (8.11.1/8.9.3) with SMTP id i06BTAY75957; Tue, 6 Jan 2004 12:29:10 +0100 (CET) (envelope-from hk@alogis.com) Message-Id: <200401061129.i06BTAY75957@alogis.com> Date: Tue, 06 Jan 2004 11:29:05 +0000 From: Holger Kipp To: stable@freebsd.org X-Mailer: phpGroupWare (http://www.phpgroupware.org) MIME-version: 1.0 Content-type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-description: Mail message body cc: current@freebsd.org Subject: perl malloc slow? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Holger.Kipp@alogis.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2004 11:29:15 -0000 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 = ; 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< -------------------------------------------------------