in reply to Re: Does eval cause that much of a performance hit?
in thread Does eval cause that much of a performance hit?

Thanks spx2! It's a federal agency I work for and we aren't able to install modules without a VERY good reason. Totally love these two suggestions though.
  • Comment on Re^2: Does eval cause that much of a performance hit?

Replies are listed 'Best First'.
Re^3: Does eval cause that much of a performance hit?
by ELISHEVA (Prior) on May 06, 2009 at 04:03 UTC

    It is a bit more work, but you can also write two comparison scripts and do several runs each with Devel::DProf, which is a core module.

    However, nothing stops you from putting Perl on your personal laptop, installing the modules, and writing a little benchmark test with some sample conditions. Don't use the federal test data of course! For various tips on installing CPAN, see Yes, even you can use CPAN.

    In either case, make sure you do several runs of each. When profiling there can be a wide variance in the results depending on what other system/app processes just happen to be running on your computer at the same time.

    Best, beth

Re^3: Does eval cause that much of a performance hit?
by spx2 (Deacon) on May 06, 2009 at 04:06 UTC
    It's a federal agency I work for and we aren't able to install modules without a VERY good reason

    Wouldn't want to upset the Federal Agency eh ? Devel::DProf and Benchmark are Perl Core modules , that means they come with Perl so you needn't install anything , and it's legal also , so use Perl Core modules , stay legal , don't get busted please !

Re^3: Does eval cause that much of a performance hit?
by ig (Vicar) on May 06, 2009 at 04:55 UTC

    If the issue is installation of new/unapproved modules into the system libraries, rather than the use of them in general, you may be able to install them in a personal library or application specific library. All you have to do to use modules from non-standard locations is add the non-standard library directory to @INC.

    I have also found Devel::NYTProf a useful profiling module.