On Mon, 2003-07-07 at 11:50, Nigel Hamilton wrote:
>       I thought I could save some RAM by stripping out comments and
> whitespace before the eval step - so I quickly wrote a Registry-like
> handler that strips comments.

Those don't take up any space in the actual compiled opcodes.  The only
space you could save is in the string that the file is initially loaded
into and the $eval string that gets built up to pass to eval().

It's probably not worth pursuing, since the savings would be small and
there is a risk of breaking code (parsing perl is hard).  If you want to
see how much it could possibly save, try just stripping a single file
before feeding it to Registry and see how much of a difference that
makes.

>       I suspect that mod_perl is stripping them for me.

Nope, it doesn't do anything like that.

>  But isn't a
> large string allocated in RAM prior to the eval?

Yes, the $eval string is as large as the full contents of the file.

- Perrin

Reply via email to