Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Storable::freeze performance problemby Smoothhound (Monk) |
on Jun 24, 2005 at 16:23 UTC ( [id://469753]=perlquestion: print w/replies, xml ) | Need Help?? |
Smoothhound has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed monks,
I've run into a frustrating performance problem using Storable. I have an application that uses Storable to freeze/thaw large hashrefs as scalars in a database. The large hashref in question holds an arbitrary number of pieces of information about an arbitrary number of job applicants in the form: $data->{$data_id}->{$applicant_id} = $value;The hashref is then used to generate reports on the data. The idea being that subsequent runs of the report don't need to retrieve all the data again. I get significant performance improvements compared to fetching the data every time for smaller sets of data but once the dataset reaches a certain size (approximately 3 $data_id's and 7500 $applicant_id's) the performance degenerates horribly. A dprofpp trace shows that it's the freezing and not the thawing that's the problem, and strangely, the problem only occurs if the freeze takes place after a thaw in the same run. And also the problem does not occur if I store/retrieve to a file, unfortunately this is not an option in our production environment. On the face of it it seems like some sort of memory bottleneck but the development machine has plenty and never swaps. I had a look at the XS code but it's been a long time since I looked any C code and it was way over my head. Basically, has anyone come across this before? or is there anything I can try to improve things? Many Thanks
Back to
Seekers of Perl Wisdom
|
|