develooper Front page | perl.perl5.porters | Postings from June 2002 bloat (was Re: threads and use Config)

Thread Previous | Thread Next
Nicholas Clark
June 28, 2002 06:15
Subject: bloat (was Re: threads and use Config)
Message ID:
On Wed, Jun 26, 2002 at 12:05:31AM +0200, Arthur Bergman wrote:
> Hi
> Since Simon pointed out to me that both DynaLoader AND C<use 
> Config> I have decided NOT to remove the dependency of from 
> Any sufficiently advanced perl program has with all probability 
> included.
> If you have a problem with bloat, please fix

Why does use an (effectively) an embedded copy of
I see that it has a config_sh method to return the entire verbatim,
but do that many programs use it?

Is the idea of the tied hash to reduce memory usage (don't build expensive
hash structures when a single scalar is far more compact)?
[I seem to remember Ilya Z being annoyed that a measurable proportion of
memory needed by 'use POSIX ...' was all the structures build for Exporter,
and I think he started working on a better tied hash implementation to allow
lazy construction of Exporter structures, and thereby reduce memory for the
common case of 'use POSIX;']

Or is it just a way to avoid parsing the file to build the hash
of all values at load time?

Considering that is a pre-generated file, surely it would make
more sense either to

a: Write out perl code à la Data::Dumper to build a real hash straight off
   like any regular perl module

b: Still have a tied hash with keys built from a single scalar, but make the
   scalar much faster to pass (none of that messy choosing between '' or ""

either way, the literal could be implemented by putting that
scalar in (say) Config/ and using require to pull it in if

This would be a proposal for 5.9, and hopefully 5.8.1

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About