SlideShare a Scribd company logo
1 of 65
Download to read offline
Devel::NYTProf
     Chia-liang Kao
    clkao@clkao.org
     Shibuya.pm#11
自己
介紹
高
嘉良
台湾
 人
日本語
日本語
不會
Perl
黑客
Hate


慢

 
“Always profile
before optimize”
Devel::DProf
% perl -d:DProf foo.pl
% dprofpp
% dprofpp
Total Elapsed Time = 2.563600 Seconds
  User+System Time = 0.703600 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c      Name
 6.96   0.049 0.067      15   0.0033 0.0045      Prophet::Replica::sqlite::BEGIN
 6.82   0.048 0.049      41   0.0012 0.0012      Mouse::Meta::Method::Constructor::
                                                 generate_constructor_method_inline
 5.40   0.038   0.038    464   0.0001 0.0001     Params::Validate::_validate
 4.97   0.035   0.030     86   0.0004 0.0003     Mouse::Meta::Method::Accessor::gen
                                                 erate_accessor_method_inline
 4.69   0.033   0.043    555   0.0001 0.0001     Prophet::Replica::sqlite::get_reco
                                                 rd_props
 4.12   0.029   0.029    166   0.0002   0.0002   DBI::st::fetchall_arrayref
 3.84   0.027   0.035    412   0.0001   0.0001   DateTime::Locale::_registered_id
 3.55   0.025   0.077     90   0.0003   0.0009   Mouse::Meta::Attribute::create
 2.84   0.020   0.020      6   0.0033   0.0033   Mouse::Meta::Attribute::BEGIN
 2.84   0.020   0.154      1   0.0199   0.1537   App::SD::Util::BEGIN
 2.56   0.018   0.018    501   0.0000   0.0000   Scalar::Util::blessed
 2.27   0.016   0.055    449   0.0000   0.0001   DateTime::Locale::_register
 1.42   0.010   0.087   4454   0.0000   0.0000   Mouse::Meta::Method::Accessor::__A
                                                 NON__
 1.42   0.010   0.010      1   0.0100 0.0100     Config::TIEHASH
 1.42   0.010   0.000     41   0.0002 0.0000     Mouse::Meta::Method::Constructor::
                                                 _generate_processattrs
Sub
Level
% perl -d:DProf foo.pl
% perl -d:DProf foo.pl
Segmentation fault.
Devel::NYTProf
    by Tim Bunce
DBI
作者
Line
Level
block
Level
使用
方法
% perl -d:NYTProf foo.pl
% nytprofhtml
Line
Level
Line
Level
Line
Level
Line
Level
Line
Level
Even
works
with
eval!
Use
it!
Last
Weekend
OSDC.TW
  台北
小籠包
Rasmus
 showed
nice
PHP

calltree
I
want

that
for

 Perl!
Calltree?
So
here
you
go
(Never
make

  a
Perl

  hacker

 jealous)
kcachegrind
% perl -d:NYTProf foo.pl
% nytprofcg
% kcachegrind nytprof
NYTProf
is

 more
than

    not

 crashing
DB::enable_profile();
.....
DB::disable_profile();
Per-request
 Profiling

 for
Jifty
Many
more

 goodies

   from

 NYTProf
cpan Devel::NYTProf


http://code.google.com/p/perl-devel-nytprof/
謝謝!

More Related Content

What's hot

Lightning talk second
Lightning talk secondLightning talk second
Lightning talk secondShinUsuda
 
Invoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoInvoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoNaN-tic
 
数式を構文解析した話
数式を構文解析した話数式を構文解析した話
数式を構文解析した話y1r96 Ueno
 
Docstringを書こう!
Docstringを書こう!Docstringを書こう!
Docstringを書こう!cocodrips
 
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru Group
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru GroupМаксим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru Group
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru GroupMail.ru Group
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеPlatonov Sergey
 
Affär - inte teknik
Affär - inte teknikAffär - inte teknik
Affär - inte teknikPer Åström
 
Modern Mobile Web Apps
Modern Mobile Web AppsModern Mobile Web Apps
Modern Mobile Web Appsdynamis
 

What's hot (10)

Pkcs11
Pkcs11Pkcs11
Pkcs11
 
Lightning talk second
Lightning talk secondLightning talk second
Lightning talk second
 
Invoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajoInvoke y como poner en marcha un entorno de trabajo
Invoke y como poner en marcha un entorno de trabajo
 
数式を構文解析した話
数式を構文解析した話数式を構文解析した話
数式を構文解析した話
 
Docstringを書こう!
Docstringを書こう!Docstringを書こう!
Docstringを書こう!
 
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru Group
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru GroupМаксим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru Group
Максим cdump Андреев, WPAD, Security Meetup 9 апреля, Mail.Ru Group
 
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговлеТененёв Анатолий, Boost.Asio в алгоритмической торговле
Тененёв Анатолий, Boost.Asio в алгоритмической торговле
 
Affär - inte teknik
Affär - inte teknikAffär - inte teknik
Affär - inte teknik
 
Modern Mobile Web Apps
Modern Mobile Web AppsModern Mobile Web Apps
Modern Mobile Web Apps
 
Config
ConfigConfig
Config
 

More from clkao

Open Source, Open Data, Open Government
Open Source, Open Data, Open GovernmentOpen Source, Open Data, Open Government
Open Source, Open Data, Open Governmentclkao
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years laterclkao
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webclkao
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webclkao
 
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy"Lego Programming" with Lorzy
"Lego Programming" with Lorzyclkao
 
Trading With Open Source Tools
Trading With Open Source ToolsTrading With Open Source Tools
Trading With Open Source Toolsclkao
 
Twopenhack08 Fnord
Twopenhack08 FnordTwopenhack08 Fnord
Twopenhack08 Fnordclkao
 
Svk Br Yapceu2008
Svk Br Yapceu2008Svk Br Yapceu2008
Svk Br Yapceu2008clkao
 
prototype::signatures
prototype::signaturesprototype::signatures
prototype::signaturesclkao
 
Leon & Andrea
Leon & AndreaLeon & Andrea
Leon & Andreaclkao
 

More from clkao (11)

Open Source, Open Data, Open Government
Open Source, Open Data, Open GovernmentOpen Source, Open Data, Open Government
Open Source, Open Data, Open Government
 
Trading with opensource tools, two years later
Trading with opensource tools, two years laterTrading with opensource tools, two years later
Trading with opensource tools, two years later
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
AnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time webAnyMQ, Hippie, and the real-time web
AnyMQ, Hippie, and the real-time web
 
"Lego Programming" with Lorzy
"Lego Programming" with Lorzy"Lego Programming" with Lorzy
"Lego Programming" with Lorzy
 
Trading With Open Source Tools
Trading With Open Source ToolsTrading With Open Source Tools
Trading With Open Source Tools
 
Twopenhack08 Fnord
Twopenhack08 FnordTwopenhack08 Fnord
Twopenhack08 Fnord
 
Svk Br Yapceu2008
Svk Br Yapceu2008Svk Br Yapceu2008
Svk Br Yapceu2008
 
prototype::signatures
prototype::signaturesprototype::signatures
prototype::signatures
 
Leon & Andrea
Leon & AndreaLeon & Andrea
Leon & Andrea
 

Devel::NYTProf