<HTML>
<HEAD>
<TITLE>Wow. The New York Times profiler.</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Wow. The New York Times profiler is way too cool and insanely easy to use.<BR>
<BR>
Question: I'm just loading a little Moose object and printing it. Why is it taking over a second??<BR>
<BR>
Answer: Use the New York Times profiler:<BR>
<BR>
$ perl -d:NYTProf j.pl<BR>
[123] Jay Hannah<BR>
$ nytprof nytprof.out<BR>
<BR>
Result:<BR>
<BR>
<a href="http://jay.mammoth.org/tmp/nytprof/">http://jay.mammoth.org/tmp/nytprof/</a><BR>
<BR>
Can you find the problem? -grin-<BR>
<BR>
Hint: In "Employee::string" at the top, click "string". There's my source code. See the problem?<BR>
<BR>
Cheers,<BR>
<BR>
j<BR>
<BR>
<BR>
<BR>
(<BR>
Note that you currently need the Google Code SVN version to see the code inside Moose objects. CPAN version is not yet sufficient.<BR>
<a href="http://code.google.com/p/perl-devel-nytprof/source/checkout">http://code.google.com/p/perl-devel-nytprof/source/checkout</a><BR>
)<BR>
<BR>
<BR>
The source code:<BR>
<BR>
$ cat j.pl<BR>
#!/usr/bin/perl<BR>
<BR>
use Employee;<BR>
<BR>
my $e = Employee->new();<BR>
$e->first_name("Jay");<BR>
$e->last_name("Hannah");<BR>
$e->employee_id(123);<BR>
<BR>
print $e->string, "\n";<BR>
<BR>
<BR>
Takes over a second to run:<BR>
<BR>
$ time perl j.pl<BR>
[123] Jay Hannah<BR>
<BR>
real 0m1.256s<BR>
user 0m0.233s<BR>
sys 0m0.021s<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>