.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Benchmark::Apps 3pm" .TH Benchmark::Apps 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Benchmark::Apps \- Simple interface to benchmark applications. .SH "SYNOPSIS" .IX Header "SYNOPSIS" This module provides a simple interface to benchmark applications (not necessarily Perl applications). .PP .Vb 1 \& use Benchmark::Apps; \& \& my $commands = { \& cmd1 => \*(Aqrun_command_1 with arguments\*(Aq, \& cmd2 => \*(Aqrun_command_2 with other arguments\*(Aq, \& }; \& \& my $conf = { pretty_print=>1, iters=>5 }; \& \& Benchmark::Apps::run( $commands, $conf ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module can be used to perform simple benchmarks on programs. Basically, it can be used to benchmark any program that can be called with a system call. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "run" .IX Subsection "run" This method is used to run benchmarks. It runs the commands described in the hash passed as argument. It returns an hash of the results each command. A second hash reference can be passed to this method: a configuration hash reference. The values passed in this hash override the default behaviour of the run method. The configuration options available at this moment are: .ie n .IP """pretty_print""" 4 .el .IP "\f(CWpretty_print\fR" 4 .IX Item "pretty_print" When enabled it will print to stdout, in a formatted way the results of the benchmarks as they finish running. This option should de used when you want to run benchmarks and want to see the results progress as the tests run. You can disable it, so you can perform automated benchmarks. .Sp Options: true (1) or false (0) .Sp Default: false (0) .ie n .IP """iters""" 4 .el .IP "\f(CWiters\fR" 4 .IX Item "iters" This is the number of iterations that each test will run. .Sp Options: integer greater than 1 .Sp Default: 5 .ie n .IP """args""" 4 .el .IP "\f(CWargs\fR" 4 .IX Item "args" This is a reference to an anonymous function that will calculate the command argument based on the iteraction number. .Sp Options: any function reference that returns a string .Sp Default: empty function: always returns an empty string, which means no arguments will be given to the command .SS "run" .IX Subsection "run" This method runs the commands described in the hash passed as argument. It returns an hash of the results and return codes for each command. .SS "pretty_print" .IX Subsection "pretty_print" This method is used to print the final result to \s-1STDOUT\s0 before returning from the \f(CW\*(C`run\*(C'\fR method. .SS "time_this" .IX Subsection "time_this" This method is not meant to be used directly, although it can be useful. It receives a command line and executes it via system, taking care of registering the elapsed time. .SH "EXAMPLES" .IX Header "EXAMPLES" Check files in \f(CW\*(C`examples/\*(C'\fR. .SH "AUTHOR" .IX Header "AUTHOR" Aberto Simoes (aka ambs), \f(CW\*(C`\*(C'\fR Nuno Carvalho (aka smash), \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \f(CW\*(C`bug\-benchmark\-apps at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Benchmark::Apps .Ve .PP You can also look for information at: .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search MetaCPAN .Sp .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008 Aberto Simoes, Nuno Carvalho, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.