Benchmark::Forking::ReadMe - About the forking benchmarks distribution
The standard Benchmark module can sometimes report inaccurate or misleading results, in part because it doesn't isolate its test cases from one another. This means that the order that cases are run in can influence the results, because side effects, either obvious or obscure, can accumulate and affect later tests.
Data in global variables is an obvious source of side effects; in the below example, the grep takes longer as more items are pushed onto the array, so the test functions that run later will be reported by Benchmark as being slower:
cmpthese( 1000, { "test_1" => sub { push @global, scalar grep 1, @global }, "test_2" => sub { push @global, scalar grep 1, @global }, "test_3" => sub { push @global, scalar grep 1, @global }, } );
More cryptic sources of side effects can include cache priming, idiosyncrasies of the underlying Perl implementation, or the state of the operating system and environment. For example, if the code to be benchmarked require a lot of in-process RAM, earlier tests may be slowed down by having to allocate the memory the first time, or later tests may be slowed down by having to pick through the heap looking for free space. These effects are difficult to predict and can be laborious to identify and compensate for.
This module provides a solution to most aspects of this problem. Once you use Benchmark::Forking, the example benchmark above will report the correct conclusion that the three identical tests run at approximately the same speed.
This is version 0.99 of Benchmark::Forking.
This release has been tested succesfully on the following platforms: 5.6.1 on darwin
This module is new and being distributed for the first time. An initial discussion was held at the Perl Monks community (http://perlmonks.org/?node_id=388481).
http://perlmonks.org/?node_id=388481
This module's CPAN registration should read:
Name DSLIP Description -------------- ----- --------------------------------------------- Benchmark:: Grp 3 Development Support ::Forking Rdphp Run benchmarks in separate processes
First version written September 3.
Expanded documentation and packaged for distribution September 5.
This module should work with any version of Perl 5, without platform dependencies or additional modules beyond the core distribution.
You should be able to install this module using the CPAN shell interface:
perl -MCPAN -e 'install Benchmark::Forking'
Alternately, you may retrieve this package from CPAN (http://search.cpan.org/~evo/) or from the author's site (http://www.evoscript.org/Benchmark-Forking).
http://search.cpan.org/~evo/
http://www.evoscript.org/Benchmark-Forking
After downloading the distribution, follow the normal procedure to unpack and install it, using the commands shown below or their local equivalents on your system:
tar xzf Benchmark-Forking-*.tar.gz cd Benchmark-Forking-* perl Makefile.PL make test && sudo make install
If you have questions or feedback about this module, please feel free to contact the author at the below address. Although there is no formal support program, I do attempt to answer email promptly.
Bug reports that contain a failing test case are greatly appreciated, and suggested patches will be promptly considered for inclusion in future releases.
To report bugs via the CPAN web tracking system, go to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Benchmark-Forking or send mail to Dist=Benchmark-Forking#rt.cpan.org, replacing # with @.
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Benchmark-Forking
Dist=Benchmark-Forking#rt.cpan.org
#
@
If you've found this module useful or have feedback about your experience with it, consider sharing your opinion with other Perl users by posting your comment to CPAN's ratings system (http://cpanratings.perl.org/rate/?distribution=Benchmark-Forking).
http://cpanratings.perl.org/rate/?distribution=Benchmark-Forking
For more general discussion, you may wish to post a message on PerlMonks (http://perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom) or on the comp.lang.perl.misc newsgroup (http://groups.google.com/groups?group=comp.lang.perl.misc).
http://perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom
http://groups.google.com/groups?group=comp.lang.perl.misc
Developed by Matthew Simon Cavalletto at Evolution Softworks. You may contact the author directly at evo@cpan.org or simonm@cavalletto.org.
evo@cpan.org
simonm@cavalletto.org
Custom development and technical consulting are available at www.evolutionsoftworks.com. More free Perl software is available at www.evoscript.org.
www.evolutionsoftworks.com
www.evoscript.org
Inspired by a discussion with Jim Keenan in the Perl Monks community. My thanks also to other members of the community for feedback on this module, in particular to graff, tachyon, Aristotle, and pbeckingham.
Copyright 2004 Matthew Simon Cavalletto.
You may use, modify, and distribute this software under the same terms as Perl.
To install Benchmark::Forking, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Benchmark::Forking
CPAN shell
perl -MCPAN -e shell install Benchmark::Forking
For more information on module installation, please visit the detailed CPAN module installation guide.