On Mon, May 23, 2005 at 10:14:58AM +0200, Elizabeth Mattijsen wrote:
> At 12:43 AM +0100 5/22/05, Nicholas Clark wrote:
> >Currently perl creates a scalar for the SCALAR slot when it creates a
> >typeglob, because it assumes that it's likely to be needed.
> >In these days of use strict, this assumption is very wrong, because most
> >code uses lexicals, so we're wasting a lot of memory. If anything, it
> >should create a subroutine stub.
> 
> In these days of ithreads, you'd want nothing to be created, as 
> anything you create without need, will be copied to each thread. 
> Where it won't be needed either!  Eating up CPU and RAM 
> unnecessarily, times the number of threads.

OK. Change 25009 makes a start on this. If you compile with
-DPERL_DONT_CREATE_GVSV then gv_init sets GvSV() to NULL, rather than a new
SV. Right now it's not the default, because with it:

Failed Test                       Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
../ext/Compress/Zlib/t/03examples               13    4  30.77%  5 7-9
../ext/Devel/DProf/t/DProf.t                    20   19  95.00%  1-10 12-20
../ext/Devel/PPPort/t/ppphtest.t               134    2   1.49%  2-3
../lib/ExtUtils/t/Command.t          0    10    38   74 194.74%  2-38
../lib/File/Temp/t/object.t          0    10    26   50 192.31%  2-26
../lib/NEXT/t/next.t                 0    10    ??   ??       %  ??
../lib/Tie/Array/std.t               0    10    ??   ??       %  ??
../lib/strict.t                                111    1   0.90%  30
../lib/warnings.t                              554    2   0.36%  255 276
comp/cpp.t                                      ??   ??       %  ??
io/argv.t                            0    10    22   42 190.91%  1-22
io/inplace.t                         0    10     2    4 200.00%  1-2
io/iprefix.t                         0    10     2    4 200.00%  1-2
op/array.t                           0    10    ??   ??       %  ??
op/goto.t                            0    10    56  108 192.86%  3-56
op/method.t                          0    10    ??   ??       %  ??
op/pat.t                             0    10  1178 2304 195.59%  27-1178
op/ref.t                                        89    1   1.12%  67
op/sub_lval.t                        0    10    ??   ??       %  ??
run/fresh_perl.t                                94    1   1.06%  78
run/switchPx.t                                  ??   ??       %  ??
run/switches.t                       2   512    26    4  15.38%  25-26
31 tests and 242 subtests skipped.
Failed 22/1017 test scripts, 97.84% okay. 1326/108808 subtests failed, 98.78% 
okay.

I hope that we can get this list down to zero rather soon, and make it the
default for 5.9. As it's a compile time option, I don't see any fundamental
reason not to integrate it to maint, although (obviously) it would default to
off (ie retain the current behaviour) with suitably dire warnings about "test
thoroughly" for anyone who wants to use it in production with 5.8.x

Nicholas Clark

Reply via email to