Benchmark::Serialize::Library - Library of serialization modules
Version 0.08
use Benchmark::Serialize::Library; Benchmark::Serialize::Library->register( MyModule => { deflate => sub { MyModule::deflate( $_[0] ) }, inflate => sub { MyModule::inflate( $_[0] ) }, } ); my %benchmarks = Benchmark::Serialize::Library->load( ":all" );
This module contains a library of serialization routines for use with Benchmark::Serialize
This class provides the following methods
Registers a new benchmarkable form of serialization. A specification is a hashref containing the following fields:
A coderef taking one argument (a perl structure) and returns the serialized structure
A coderef taking one argument (a serialized structure) and returns the perl structure
A array reference containing modules to be loaded. The default value is the name of the benchmark.
A coderef returning a list of aditional arguments for the deflate and inflate routines. Only run once during initialization of benchmark.
All additional fields are interpreted as tags used for selecting benchmarks.
Loads and initializes a number of benchmarks. Arguments can be either registered names, registered tags, or unregistered benchmarks following the same format as the register method.
register
Returns a list of benchmarks
Returns a list of all available benchmarks. For each benchmark both the name and the version is returned in a array ref.
Each benchmark is represented by a object with the following mathods
Takes a perl structure as argument and returns the serialized form
Takes a serialized form as argument and returns the perl structure.
Returns the name of the benchmark
Returns the module version of the benchmark. For benchmark needing multiple loaded modules, the first in the specification list is used.
The following tags are usec in the standard library
Peter Makholm, <peter at makholm.net>
<peter at makholm.net>
Please report any bugs or feature requests to bug-benchmark-serialize at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Benchmark-Serialize. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-benchmark-serialize at rt.cpan.org
This module started out as a script written by Christian Hansen, see http://idisk.mac.com/christian.hansen/Public/perl/serialize.pl
Copyright 2009-2010 Peter Makholm.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Benchmark::Serialize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Benchmark::Serialize
CPAN shell
perl -MCPAN -e shell install Benchmark::Serialize
For more information on module installation, please visit the detailed CPAN module installation guide.