Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Keep It Simple, Stupid
 
PerlMonks  

Re^2: enabling XML::Rabbit serialization

by glasswalk3r (Pilgrim)
on Dec 28, 2012 at 11:37 UTC ( #1010687=note: print w/ replies, xml ) Need Help??


in reply to Re: enabling XML::Rabbit serialization
in thread enabling XML::Rabbit serialization

Your observation is right Jenda, but I would like to give a try to Sereal since it seems to be faster and use less memory.

And yes, the script executes very quickly since it will be a Nagios plugin. Parsing the XML once is useful because somebody must configure de plugin, but for later executions, recovering the data from the XML as plain Moose objects would be faster and use less memory. After parsing the XML, it is just a matter to save the new objects in the file system and recovering them latter. Since of it like a cache.

Looks like I will need to clone the XML::Rabbit objects by copying their "attributes" to plain Moose objects.

Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill


Comment on Re^2: enabling XML::Rabbit serialization
Re^3: enabling XML::Rabbit serialization
by Jenda (Abbot) on Dec 28, 2012 at 11:50 UTC

    Do they have to be Moose objects? And does it have to be XML::Rabbit? You can just as easily set up XML::Rules to build a data structure (either plain or blessed as plain old Perl objects) and thus have something easily serializable.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      My project already uses Moose extensively. Besides, XML::Rabbit really does what I expected despite this tiny detail :-)

      Alceu Rodrigues de Freitas Junior
      ---------------------------------
      "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-04-16 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (432 votes), past polls