glasswalk3r has asked for the wisdom of the Perl Monks concerning the following question:
Hello there monks,
I started using XML::Rabbit a couples of days ago and I quite content with it for reading XML configuration files.
I would like to add some optimization to the program by serializing the objects to the disk and avoid some memory consumption by recovering the values over and over from XML.
The problem is that XML::Rabbit objects do not hold the recovered values from XPath expression in classes attributes. I tried to use a naive approach with Storable but this is what I got from it:
c:\Temp>rabbit.pl Bizarre copy of UNKNOWN in subroutine entry at C:/Perl/site/lib/XML/Li +bXML/XPathContext.pm line 67. PmmREFCNT_dec: REFCNT decremented below 0 for 2ca1798! at C:/Perl/site +/lib/XML/LibXML/XPathContext.pm line 67. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe650! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe638! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe620! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe608! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe5d8! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe5a8! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe5c0! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cbe290! at C:/Perl/site +/lib/XML/LibXML.pm line 1549. PmmREFCNT_dec: REFCNT decremented below 0 for 2cdff18! at C:/Perl/site +/lib/XML/LibXML.pm line 1549.
Considering that XML::Rabbit is Moose based, what do you recommend to use for objects serialization? I thought about cloning the XML::Rabbit objects, saving the values as attributes and keeping the references as necessary, but this looks like a lot of trouble to do it.
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: enabling XML::Rabbit serialization
by Jenda (Abbot) on Dec 19, 2012 at 19:02 UTC | |
by glasswalk3r (Friar) on Dec 28, 2012 at 11:37 UTC | |
by Jenda (Abbot) on Dec 28, 2012 at 11:50 UTC | |
by glasswalk3r (Friar) on Jan 04, 2013 at 00:46 UTC | |
|
Re: enabling XML::Rabbit serialization
by tobyink (Canon) on Dec 19, 2012 at 18:34 UTC |