develooper Front page | perl.perl5.porters | Postings from June 2001

[PATCH perlfaq3.pod] and a question about it.

Thread Next
From:
Jonathan Stowe
Date:
June 26, 2001 12:30
Subject:
[PATCH perlfaq3.pod] and a question about it.
Message ID:
Pine.LNX.4.33.0106261936150.1935-100000@orpheus.gellyfish.com
For the benefit of people who might not be reading the FAQ sequentially I
propose :

--- pod/perlfaq3.pod~	Tue Jun 26 19:29:38 2001
+++ pod/perlfaq3.pod	Tue Jun 26 19:39:57 2001
@@ -413,7 +413,9 @@
 on optimization, too.  Advice on benchmarking boils down to: benchmark
 and profile to make sure you're optimizing the right part, look for
 better algorithms instead of microtuning your code, and when all else
-fails consider just buying faster hardware.
+fails consider just buying faster hardware.  You will probably want to
+read the answer to the earlier question ``How do I profile my Perl
programs?''
+if you haven't done already.

 A different approach is to autoload seldom-used Perl code.  See the
 AutoSplit and AutoLoader modules in the standard distribution for



Also reading the item :

=head2 How can I free an array or hash so my program shrinks?

Where it says :

   We've had reports that on Linux (Redhat 5.1) on Intel, C<undef
   $scalar> will return memory to the system, while on Solaris 2.6 it
   won't.  In general, try it yourself and see.


It strikes me as being a leetle out of date - would anyone like to report
a more recent OS doing this - to be quite honest I'm not quite sure
how one would go about finding out whether this was the case except in a
very unscientific way - on Redhat 7.0 it is very obvious that it *is*
happening when you run :

#!/usr/bin/perl

$foo = 'xx' x 20000000;

print "got it\n";

$x = <STDIN>;

undef $foo;
$x = <STDIN>;


If anyone else has anything else to be reported then maybe this should be
updated.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About