On Fri, 2005-12-16 at 11:52 -0600, Chase Venters wrote:
> I wonder then if Perl would be smart enough to understand that the data is 
> constant and not copy it with Perl_clone()?

I'm pretty sure the answer is no.  You can try marking things shared
with threads::shared and see if that gets you anything.

> I suppose what I really should 
> be doing here is writing a test as a perl embedded app that does various 
> things to test out clone's behavior.

Or just try loading the same data in a threaded mod_perl in different
ways and look at how much memory it uses.

> Actually tried? No. But the data is in essence a big table of information 
> about how to build SQL queries from method calls, validate/convert the 
> information in the process, and pack it into objects. Having to first 
> fetch the model itself out of SQL (its structure not even lending to easy 
> storage in such a DB) would be clunky / awkward, and would basically 
> involve an extra query or set of queries against a table for every 
> request.

You might be surprised by how fast something like Cache::FastMmap can be
if you break your data up nicely across keys.  The thing that hurts is
when you store it as one big nested structure, requiring serialization.

- Perrin

Reply via email to