[Omaha.pm] Wow. The New York Times profiler.

Jay Hannah jhannah at omnihotels.com
Tue Aug 26 10:40:33 PDT 2008


Wow. The New York Times profiler is way too cool and insanely easy to use.

Question:  I'm just loading a little Moose object and printing it. Why is it
taking over a second??

Answer:    Use the New York Times profiler:

$ perl -d:NYTProf j.pl
[123] Jay Hannah
$ nytprof nytprof.out

Result:

   http://jay.mammoth.org/tmp/nytprof/

Can you find the problem?  -grin-

Hint: In "Employee::string" at the top, click "string". There's my source
code. See the problem?

Cheers,

j



(
   Note that you currently need the Google Code SVN version to see the code
inside Moose objects. CPAN version is not yet sufficient.
   http://code.google.com/p/perl-devel-nytprof/source/checkout
)


The source code:

$ cat j.pl
#!/usr/bin/perl

use Employee;

my $e = Employee->new();
$e->first_name("Jay");
$e->last_name("Hannah");
$e->employee_id(123);

print $e->string, "\n";


Takes over a second to run:

$ time perl j.pl
[123] Jay Hannah

real    0m1.256s
user    0m0.233s
sys     0m0.021s


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/omaha-pm/attachments/20080826/b2815fe2/attachment.html>


More information about the Omaha-pm mailing list