Re: Reducing memory footprint?

Nick Ing-Simmons (nik@tiuk.ti.com)
Thu, 11 Mar 1999 12:21:21 GMT


Alan Burlison <Alan.Burlison@uk.sun.com> writes:
>I've done a very simplistic test - a script that allocates 2,560,000
>10-character strings and pushes them onto an array.  The results are as
>follows:
>
>		   malloc version
>		System		Perl		Difference
>Heap space	140184k		108824k		22%
>Elapsed time	1:30.274	1:23.708	7.3%
>User time	1:27.881	1:22.653	5.9%
>System time	0.976		2.076		53%
>
>The size difference I can believe - after all perl's malloc is
>(hopefully!) pretty optimal for perl usage.  I can also believe the 5.9%
>difference in user time - the Solaris malloc has the overhead associated
>with being thread safe - I think less than 6% overhead for thread safety
>is pretty impressive.  The system time is also explainable if you count
>the number of calls to brk (truss -c).  Perl malloc makes 202 calls to
>brk during the script execution, but Solaris malloc makes 26,880 calls!

Do you have system time right-way-round then?

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.