<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: &nbsp;I'm just loading a little Moose object and printing it. Why is it taking over a second??<BR>
<BR>
Answer: &nbsp;&nbsp;&nbsp;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>
&nbsp;&nbsp;&nbsp;<a href="http://jay.mammoth.org/tmp/nytprof/">http://jay.mammoth.org/tmp/nytprof/</a><BR>
<BR>
Can you find the problem? &nbsp;-grin-<BR>
<BR>
Hint: In &quot;Employee::string&quot; at the top, click &quot;string&quot;. There's my source code. See the problem?<BR>
<BR>
Cheers,<BR>
<BR>
j<BR>
<BR>
<BR>
<BR>
(<BR>
&nbsp;&nbsp;&nbsp;Note that you currently need the Google Code SVN version to see the code inside Moose objects. CPAN version is not yet sufficient.<BR>
&nbsp;&nbsp;&nbsp;<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-&gt;new();<BR>
$e-&gt;first_name(&quot;Jay&quot;);<BR>
$e-&gt;last_name(&quot;Hannah&quot;);<BR>
$e-&gt;employee_id(123);<BR>
<BR>
print $e-&gt;string, &quot;\n&quot;;<BR>
<BR>
<BR>
Takes over a second to run:<BR>
<BR>
$ time perl j.pl<BR>
[123] Jay Hannah<BR>
<BR>
real &nbsp;&nbsp;&nbsp;0m1.256s<BR>
user &nbsp;&nbsp;&nbsp;0m0.233s<BR>
sys &nbsp;&nbsp;&nbsp;&nbsp;0m0.021s<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>