in reply to How can one best measure compile time of their Perl script?

I generally do:

time perl -c script.pl
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Replies are listed 'Best First'.
Re^2: How can one best measure compile time of their Perl script?
by oiskuu (Hermit) on Nov 30, 2013 at 17:37 UTC
    Really? Has to be pretty big script to take more than a few millisec. For linux, there's a tool bundled with sources (linux/tools/perf). Far more precise and informational.

      "Really? Has to be pretty big script to take more than a few millisec."

      This one-liner seems to take more than a few milliseconds:

      time perl -c -e'use Moose; 1;'
      use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
      Thanks, oiskuu.

      Nice output. While I do have stat, and lstat for that matter, and of course, perl. I don't have perf -- at least not by name. Probably have something by another name (I'm using *BSD).

      Which means, for the sake of portability, I should use something derived from Perl itself. Though
      perl -c
      seems to provide some interesting statistics. :)

      Thanks for the informative response, oiskuu.

      --Chris

      #!/usr/bin/perl -Tw
      use Perl::Always or die;
      my $perl_version = (5.12.5);
      print $perl_version;