Perl ������ץȤ��٤��������ꤹ����ˡ - Devel::Profiler / Devel::NYTProf
���Ż��ǽƤ� Sledge ���ץ꤬����ΤǤ�����������٥ƥ��Ȥ�Ԥä���̤Ӥä��ꤹ�뤳�Ȥ˸��ԥ��ץ�Σ������٤����Ȥ�Ƚ�����Ƥ��ޤ��ޤ���������orz
Sledge �ե졼�������Ȥ��Ť��ʤ����ȤϺ��ޤǤηи��Ǥ狼�äƤ�ΤǤ������ɤ��ˤ⥽������ľ���Ƥ�������Ǥϸ���������Ǥ��ʤ�����������ʳ�������Τ��ץ��ե�����Ǥ����ץ��ե�����θ汢���٤���������ꤹ�뤳�Ȥ��Ǥ���̵�������ꤹ��ѥե����ޥ����뤳�Ȥ��Ǥ��ޤ������������Ƥ˴ؤ��ƤϤޤ��̥���ȥ�ˤơ�
���ơ��ץ��ե������Ȥ��ȥץ������¹Ի��γƼ��������������ǽ���Ϥ�Ԥ����Ȥ���ǽ�Ǥ����ץ��ե�����ˤĤ��Ƥ⤦�����ܤ�������ˤϡ���ǽ���� - Wikipedia����������ɤ���ɤ��Ǥ��礦��
�ץ��ե����������Ū�����¤Ȥ��ƥ����������ɤΰ��֤ȴ�Ϣ�դ��ƥ��٥�Ȥ�Ͽ���뤿�ᡢ�ǡ����Υ��������оݤȤʤä������ɤΥ������ˤۤ����㤹�롣�������ȥ졼���Υ������ϥץ������μ¹Ի��֤����㤷���������ȤʤäƤ��ޤ����ᡢ����Ū�Ǥʤ����Ȥ⤢�롣
���ơ����֤��Ϥ�������٤ˤ��Ƥ����� Perl �ˤ����ƤΥץ��ե������ޤȤ�Ƥߤޤ�����
��ǽ������������ꤹ�뤿��� Perl �ץ��ե�����ޤȤ�
- Devel::DProf��-��http://search.cpan.org/~ilyaz/DProf-19990108/DProf.pm
-
�Τ���Ȥ��Ƥ���ץ��ե����顣���֥롼����ñ�̤ǽ������֤��¬���Ƥ���롣
The Devel::DProf package is a Perl code profiler. This will collect information on the execution time of a Perl script and of the subs in that script. This information can be used to determine which subroutines are using the most time and which subroutines are being called most often. This information can also be used to create an execution graph of the script, showing subroutine relationships.
- Devel::Profiler��-��http://search.cpan.org/~samtregar/Devel-Profiler-0.04/lib/Devel/Profiler.pm
-
Devel::DProf ����ξ�괹�������ꤷ�ƺ��줿��ġ���������������Ͼ��狼��䤹����Ʊ�������֥롼����ñ�̤ǽ������֤��¬���Ƥ���롣
This module implements a Perl profiler that outputs profiling data in a format compatible with dprofpp, Devel::DProf's profile analysis tool. It is meant to be a drop-in replacement for Devel::DProf.
- Devel::SmallProf��-��http://search.cpan.org/~salva/Devel-SmallProf-2.02/lib/Devel/SmallProf.pm
-
�����ɤγƥ饤����ν������֤��¬���Ƥ�����ġ���ľγ�٤��٤������Ƽ¹Ի��֤� 0.0000 �ߤ����ʤΤФä���Dz��Ϥ��Ť餤��
The Devel::SmallProf profiler is focused on the time taken for a program run on a line-by-line basis. It is intended to be as "small" in terms of impact on the speed and memory usage of the profiled program as possible and also in terms of being simple to use.
- Devel::FastProf��-��http://search.cpan.org/~salva/Devel-FastProf-0.08/lib/Devel/FastProf.pm
-
������� Devel::SmallProf ����ξ�괹�������������Τ�ޤ�����Devel::SmallProf ���٤��Τ�����ˤʤ��®�ʥ�Ĥ��ä��ȤΤ��ȤǤ���
Devel::FastProf tells you how much time has been spent on every line of your program. Devel::FastProf is a perl per-line profiler. What that means is that it can tell you how much time is spent on every line of a perl script (the standard Devel::DProf is a per-subroutine profiler). I have been the maintainer of Devel::SmallProf for some time and although I found it much more useful that Devel::DProf, it had an important limitation: it was terribly slow, around 50 times slower than the profiled script being run out of the profiler.
- Devel::NYTProf��-��http://search.cpan.org/~timb/Devel-NYTProf-2.07/lib/Devel/NYTProf.pm
-
̾���������ΤäƤޤ������������Ȥä����Ȥ�����ޤ�������ä����� TokuLog �Ǿܲ�Ƥ��ޤ����������������ɥӥ塼��Ĥ��ץ��ե�����ȤΤ��ȤǤ���Devel::FastProf ��١����� Perl ������ New York Times �Ҥ���ȯ�����⥸�塼��ȤΤ��ȤǤ���
Devel::NYTProf - Powerful feature-rich perl source code profiler NYTProf stands for 'New York Times Profiler'. Indeed, this module was initially developed from Devel::FastProf by The New York Times Co. to help our developers quickly identify bottlenecks in large Perl applications. The NY Times loves Perl and we hope the community will benefit from our work as much as we have from theirs.
- ���������������������������ޤǤΤ��ΤäƤ����������ɤ��Ȼפ���Ģ���������������������
- Devel::GraphVizProf��-��http://search.cpan.org/~lbrocard/GraphViz-2.03/lib/Devel/GraphVizProf.pm
-
Devel::SmallProf �β��ϲȷ�̤�ղ����Ʋ��Ϸ�̤������ġ����������Τ�ޤ������Ȥä����Ȥ��ʤ��ΤǤ狼��ޤ���
This module is a hack of Devel::SmallProf by Ted Ashton. It has been modified by Leon Brocard to produce output for GraphViz, but otherwise the only thing I have done is change the name. I hope to get my patches put into the main Devel::SmallProf code eventually, or alternatively read the output of Devel::SmallProf. Anyway, the normal documentation, which you can probably ignore, follows.
- Devel::WxProf��-��http://search.cpan.org/~mkutter/Devel-WxProf-0.0.1/lib/Devel/WxProf.pm
-
�Ȥä����Ȥ�����ޤ����������Τ�ޤ�����Based on Devel::DProfLB by Jeff Weisberg���ȵ��Ҥ����뤳�Ȥ��� Devel::DProf ���ȡ�install ���顼���Ǥ��Τǻ�Ƥ⤤�ޤ���
I wrote Devel::WxProf because I needed a fine-grained one-shot profiler (and because I saw that cool treemap in kcachegrind). I actually wrote it for myself. I'd be pleased if you find it useful, but I probably won't put much time into bugfixes. Send me a test and a patch if you want to speed things up. If you're really out for boosting development, I'll set up a repository I can open up...
����ץ�ץ������ˤ����� Perl �ץ��ե�����ν�����
����ץ�ץ������Ȥ��� Google AJAX Search API �ǥ������⸡�����Τ��Ѱդ��ޤ��������˴�ñ�ʥ�ΤǤ�����������Ϥ��ĺ���뤫�ȡ�
use Google::Search; use Encode; use utf8; my $site = 'http://www.drk7.jp/'; my $search = Google::Search->Web(q => "oracle site:$site"); my $result = $search->first; while ($result) { print $result->number, " ", $result->uri, "\n"; $result = $result->next; }
Devel::DProf �ˤ��ץ��ե�������ϡ��ʤ����� JSON::XS ��ʬ�ǥ��顼���ǤƤ��ޤ������ɤ�������
perl -d:DProf tt.pl dprofpp Can't call method "JSON::XS" on an undefined value at /usr/local/lib/perl5/site_perl/5.8.7/Google/Search/Response.pm line 7. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.7/Google/Search/Response.pm line 7. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.8.7/Google/Search/Response.pm line 7. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.7/Google/Search.pm line 62. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.8.7/Google/Search.pm line 62. Compilation failed in require at tt.pl line 1. BEGIN failed--compilation aborted at tt.pl line 1.
Devel::Profiler �ˤ��ץ��ե�������ϡ�JSON::PP �������ǽ�������Ƥ��뤳�Ȥ��狼�롣
perl -MDevel::Profiler tt.pl dprofpp Total Elapsed Time = 9.667928 Seconds User+System Time = 4.841928 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 25.5 1.238 2.983 1489 0.0008 0.0020 JSON::PP::string 20.4 0.991 0.991 52202 0.0000 0.0000 JSON::PP::next_chr 16.2 0.785 0.785 39387 0.0000 0.0000 JSON::PP::is_valid_utf8 3.24 0.157 0.468 1340 0.0001 0.0003 Class::MOP::Attribute::get_value 2.83 0.137 0.262 2599 0.0001 0.0001 Class::MOP::Class::construct_class_instance 2.83 0.137 0.411 2599 0.0001 0.0002 Class::MOP::Class::initialize 1.84 0.089 0.089 4004 0.0000 0.0000 JSON::PP::white 1.80 0.087 0.087 2599 0.0000 0.0000 Class::MOP::does_metaclass_exist 1.63 0.079 3.233 226 0.0004 0.0143 JSON::PP::object 1.43 0.069 0.069 2899 0.0000 0.0000 Class::MOP::Attribute::name 1.43 0.069 0.137 16 0.0043 0.0086 LWP::UserAgent::send_request 1.20 0.058 0.058 2700 0.0000 0.0000 Class::MOP::Class::get_attribute_map 1.20 0.058 0.058 1819 0.0000 0.0000 Class::MOP::Class::__ANON__::SERIAL::1::get_meta_instance 0.99 0.048 0.607 720 0.0001 0.0008 Moose::Meta::Attribute::initialize_instance_slot 0.87 0.042 0.100 2160 0.0000 0.0000 Class::MOP::Class::get_attribute [apache@srv01 test]$
Devel::SmallProf �ˤ��ץ��ե�������ϡ���ľ���ʤ긫�Ť餤��
perl -d:SmallProf tt.pl ================ SmallProf version 2.02 ================ Profile of (eval 160)[/usr/local/lib/perl5/site_perl/5.8.7/Mo Page 1 ================================================================= ������������ count wall tm cpu time line 0 0.00000 0.00000 1:The code for (eval 1 0.00000 0.00000 2:174)[/usr/local/lib/perl5/site_perl/5.8.7/Moo 1 0.00000 0.00000 3:se/Meta/Method/Constructor.pm:89] is not in 0 0.00000 0.00000 4:the symbol table. 1 0.00001 0.00000 5: 1 0.00002 0.00000 6: ������������
Devel::FastProf �ˤ��ץ��ե�������ϡ�Devel::Profiler �Ǥ������Ĥ�����˸���Τ��ȡ�
perl -d:FastProf tt.pl fprofpp -t 20 /usr/local/lib/perl5/site_perl/5.8.7/LWP/Protocol/http.pm:399 4.74429 34: my $nfound = select($fbits, undef, undef, $timeout); /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:734 0.19706 52186: $ch = substr($text, $at++, 1); /usr/local/lib/perl5/5.8.7/x86_64-linux-thread-multi/IO/Select.pm:116 0.19344 16: defined($w) && (select(undef,$w,undef,$timeout) > 0) /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:1169 0.17843 39387: return 1 if (length ($is_valid_utf8 .= $_[0] ) < $utf8_len); # continued /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:733 0.15212 52202: return $ch = undef if($at >= $len); /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:1171 0.14952 30742: return ( $is_valid_utf8 =~ s/^(?: /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:761 0.14107 42113: if((!$singlequote and $ch eq '"') or ($singlequote and $ch eq $boundChar)){ /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:836 0.12771 39387: $s .= $ch; /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:830 0.12507 39387: if ($ch =~ /[\x00-\x1f\x22\x5c]/) { # '/' ok /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:823 0.12464 39387: if( !is_valid_utf8($ch) ) { /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:822 0.11614 39387: if ($utf8) { /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:1158 0.11612 39387: unless ( $utf8_len ) { /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:829 0.11552 39387: if (!$loose) { /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:1167 0.11445 39387: return !($utf8_len = 1) unless ( $utf8_len ); /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:1159 0.11105 30742: $utf8_len = $_[0] =~ /[\x00-\x7F]/ ? 1 /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:783 0.01651 4916: $u .= $ch; /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:782 0.01631 4916: last OUTER if($ch !~ /[0-9a-fA-F]/); /usr/local/lib/perl5/site_perl/5.8.7/Class/MOP.pm:31 0.01521 2599: sub get_metaclass_by_name { $METAS{$_[0]} } /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:781 0.01477 4916: $ch = next_chr(); /usr/local/lib/perl5/site_perl/5.8.7/JSON/PP.pm:846 0.01465 4004: while( defined $ch ){
Devel::NYTProf �ˤ��ץ��ե�������ϡ�nytprof/index.html �뤳�ȤDz��Ϸ�̥�ݡ��Ȥ뤳�Ȥ��Ǥ��롣����Ū�����̤����˸��䤹�����Ϥ��뤳�Ȥ���ǽ��
perl -d:NYTProf tt.pl nytprofhtml���Ϸ�̤Υ�ݡ��ȤϤ�����Ǹ��뤳�Ȥ��Ǥ��ޤ���![]()
�Ȥ����櫓�ǡ���Ū�ʥ�������ϡ�Devel::Profiler �Ǥ������Ĥ��ơ�Devel::NYTProf �ǿ��ɤ���Τ��ɤ����Ȼפ��ޤ���
�����Ȥ䥷�����ꤤ���ޤ���