=head1 NAME

Benchmark::Forking::ReadMe - About the forking benchmarks distribution

=head1 MOTIVATION

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. 

=head1 DISTRIBUTION

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 (C<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

=head1 CHANGE HISTORY

First version written September 3.

Expanded documentation and packaged for distribution September 5.

=head1 INSTALLATION

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 (C<http://search.cpan.org/~evo/>) or from the author's site (C<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

=head1 SUPPORT

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
C<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Benchmark-Forking> or send
mail to C<Dist=Benchmark-Forking#rt.cpan.org>, replacing C<#> with C<@>.

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
(C<http://cpanratings.perl.org/rate/?distribution=Benchmark-Forking>).

For more general discussion, you may wish to post a message on PerlMonks
(C<http://perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom>) or on the
comp.lang.perl.misc newsgroup
(C<http://groups.google.com/groups?group=comp.lang.perl.misc>).

=head1 AUTHOR

Developed by Matthew Simon Cavalletto at Evolution Softworks.  You may
contact the author directly at C<evo@cpan.org> or
C<simonm@cavalletto.org>.

Custom development and technical consulting are available at
C<www.evolutionsoftworks.com>. More free Perl software is available at
C<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.

=head1 LICENSE

Copyright 2004 Matthew Simon Cavalletto. 

You may use, modify, and distribute this software under the same terms as Perl.

=cut

syntax highlighted by Code2HTML, v. 0.9.1