Sponsored Content
Top Forums Shell Programming and Scripting How to use bench mark module for sub routines in perl? Post 302517916 by vanitham on Thursday 28th of April 2011 06:52:11 AM
Old 04-28-2011
Quote:
Originally Posted by DGPickett
Not that I know PERL much, but Benchmark - perldoc.perl.org says:
cmpthese - print results of timethese as a comparison chart
and:
Code:
    # cmpthese can be used both ways as well
    cmpthese($count, {
'Name1' => '...code1...',
'Name2' => '...code2...',
    });
 
    cmpthese($count, {
'Name1' => sub { ...code1... },
'Name2' => sub { ...code2... },
    });
 
    # ...or in two stages
    $results = timethese($count, 
        {
    'Name1' => sub { ...code1... },
    'Name2' => sub { ...code2... },
        },
'none'
    );
    cmpthese( $results ) ;

I suggest the first form with no & and in single quotes.
HI,

I tried these but could not get the results.

I have to identify the sub routine which is taking a lot of time.

But i am unable to trace which part of the sub routine.

If u can help me out with this that would be really great.

REgards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace Perl Module name in all Perl scripts

I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible? I have the following statement in my scripts use myUtil; I want to change it to use myUtil777; Regards, Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies

2. Shell Programming and Scripting

Brain Bench Certification

Hi, Can anybody provide me Pointers to Practice tests or any Material to prepare for Brainbench certification in Unix Shell Scripting? Also how good is this Certification for UNIX programmers. Is it worth it? I'm planning to take this certification in 2 weeks. Kindly let me know all the pros... (0 Replies)
Discussion started by: pavan_emani
0 Replies

3. Shell Programming and Scripting

Perl Module Help

Hi All, I am using a perl module Win32::AdminMisc in my perl script. When i running in activestate perl v5.10.0 it shows folling error --- Can't locate loadable object for module Win32::AdminMisc in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at example.pl Please reply. ... (7 Replies)
Discussion started by: suprcool
7 Replies

4. Shell Programming and Scripting

Help with Perl Module

I dont know if this is a dumb question, but I am unable to move ahead and need help - There is a perl module called Header.pm which was written by someone else. I am trying to write a simple perl script which uses a function provided by the module. The function has been exported by the module... (9 Replies)
Discussion started by: NewDeb
9 Replies

5. Shell Programming and Scripting

Perl Module

Hi, Please help me!! Im wondering if anyone can help me with a problem i have with some perl modules. My problem is: I'm trying to connect remote host to a unix box from a windows machine. So i'm developing an application to do this. I'm programming it in perl with tcl/tk Gui interface.... (13 Replies)
Discussion started by: Phi01
13 Replies

6. Shell Programming and Scripting

Which Perl Module to use?

Hi, I need to read an excel binary file and write the data to a text file. Is it possible using Spreadsheet-ParseExcel-0.58 ? If not, is there any module available in CPAN to do this? Thanks, Js (1 Reply)
Discussion started by: jisha
1 Replies

7. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

8. Linux Benchmarks

ga 970a ud3 bench

fx6100 4.0ghz | BYTE UNIX Benchmarks (Version 3.11) | System -- Linux nick-GA-970A-UD3 2.6.35-32-generic #66-Ubuntu SMP Mon Feb 13 21:04:32 UTC 2012 x86_64 GNU/Linux | Start Benchmark Run: Sun Mar 18 16:59:29 CDT 2012 | 2 interactive users. Dhrystone 2 without register... (1 Reply)
Discussion started by: thirnick
1 Replies

9. Shell Programming and Scripting

Perl SSH without a perl module

I'm trying to create a perl script that will do 1 SSH session, but be able to write multiple commands to the session and receive multiple outputs. I know there are modules out there like Net:SSH::Perl, but I'm not allowed to use it. I was thinking of doing something like an open3 on an ssh... (4 Replies)
Discussion started by: mrwatkin
4 Replies

10. Shell Programming and Scripting

Perl module

I am recieiving an out of memory issue in my perl module while updating the records in the oracle table. Let me know what are the check or troubleshoot steps need to be done from my end to fix the issue. (1 Reply)
Discussion started by: ramkumar15
1 Replies
Benchmark::Apps(3pm)					User Contributed Perl Documentation				      Benchmark::Apps(3pm)

NAME
Benchmark::Apps - Simple interface to benchmark applications. SYNOPSIS
This module provides a simple interface to benchmark applications (not necessarily Perl applications). use Benchmark::Apps; my $commands = { cmd1 => 'run_command_1 with arguments', cmd2 => 'run_command_2 with other arguments', }; my $conf = { pretty_print=>1, iters=>5 }; Benchmark:Apps::run( $commands, $conf ); 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. FUNCTIONS
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: "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. Options: true(1) or false(0) Default: false(0) "iters" This is the number of iterations that each test will run. Options: integer greater than 1 Default: 5 "args" This is a reference to an anonymous function that will calculate the command argument based on the iteraction number. Options: any function reference that returns a string Default: empty function: always returns an empty string, which means no arguments will be given to the command 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. pretty_print This method is used to print the final result to STDOUT before returning from the "run" method. 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. EXAMPLES
Check files in "examples/". AUTHOR
Aberto Simoes (aka ambs), "<ambs at cpan.org>" Nuno Carvalho (aka smash), "<smash @ cpan.org>" BUGS
Please report any bugs or feature requests to "bug-benchmark-apps at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Benchmark-Apps <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Benchmark-Apps>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Benchmark::Apps You can also look for information at: o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Benchmark-Apps <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Benchmark-Apps> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Benchmark-Apps <http://annocpan.org/dist/Benchmark-Apps> o CPAN Ratings http://cpanratings.perl.org/d/Benchmark-Apps <http://cpanratings.perl.org/d/Benchmark-Apps> o Search CPAN http://search.cpan.org/dist/Benchmark-Apps <http://search.cpan.org/dist/Benchmark-Apps> COPYRIGHT &; LICENSE Copyright 2008 Aberto Simoes, Nuno Carvalho, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-01-15 Benchmark::Apps(3pm)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy