PyCon mini JP 2011 Lightning Talk




Benchmarker
a good friend for performance



  makoto kuwata
  http://www.kuwata-lab.com/
Profile
 @makotokuwata

 http://www.kwuata-lab.com/
              Perl is the
 Ruby/PHP/Python programmer

          CHAMPION!
 Creator of Erubis (*)

 Python4PHPer


                (*) default template engine on Rails 3
Question
Which is faster?
  	       	 
 	  	  	  	  	  	  	  	  	  	 

  	 
 	  	                  	  	        	     	    	    	 

  	 
 	  	                 	     	     	     	 
                           https://gist.github.com/800384
Benchmark
                                   '+' op is the fastest
                                   for short strings


plus op             0.624sec


 format                            0.887sec


   join                   0.709sec

          0   0.2   0.4      0.6       0.8      1

                           second per million
Which is faster?
    	       	 
   	  	 
      	  	  	 
 	 	  	  	 

    	     	      	 
   	  	 
      	  	  	 
 	 	  	  	  	  	 
                      https://gist.github.com/801429
Benchmark
                                              Not Same!



'+=' op                         0.431sec




'=' & '+'                          0.439sec


            0   0.1   0.2    0.3       0.4       0.5

                            second per million
Which is faster?
    	       	 
   	  	 
      	  	  	 
 	 	  	  	  	  	 

    	     	      	 
   	  	 
      	  	  	 
 	 	  	  	  	  	  	  	 
                          https://gist.github.com/801429
Benchmark

   '+=' op        0.545sec




'=' and '+'       Too Slow! Unmeasurable!


              0       0.4    0.8    1.2     1.6         2

                                   second per million
Why?
[OT] Python v.s. Perl
[OT] Python v.s. Perl
     	             	 
 	 	 	 	 	 	 	 	 	 	 	 	  	  	 	  	  	 	  	  	 	  	  	 
             	  	  	 	 	 	  	 	 	 	  	 	 	 	  	 	 	 	 

     	        	 
                     Perl is
 	 	 	 	  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 
 	 	 	 	 	  	  	  	  	  	  	  	  	  	  	 

                   AWESOME!
About Benchmarker
Benchmarker
 Benchmarking utility for Python
 A good friend for performance
 http://pypi.python.org/pypi/Benchmarker/
Example Code
Output
Remove same fot-stmt
Repeat all benchmarks
     	 
          	                                                 	    	 
 	 	  	            	  	 
 	 	       	  	  	 
 	 	 	 	        	                  	 
 	 	 	 	 	 	 
                                                Remove min & max results
Command-line Options
Benchmarker - A Good Friend for Performance
thank you

More Related Content

PPTX
Business Process Benchmarking
PPTX
Benchmarking
PPTX
Business Process Benchmarking
PDF
PPTX
Benchmarking For Best Practice
PPTX
Hotel benchmarking
ODP
Benchmarking
PPT
Benchmarking
Business Process Benchmarking
Benchmarking
Business Process Benchmarking
Benchmarking For Best Practice
Hotel benchmarking
Benchmarking
Benchmarking

Viewers also liked (6)

PPT
Presentacion Benchmarking
PDF
Benchmarking
PPS
Benchmarking ppt
PPTX
Decision Making Process
PPT
Benchmarking
PPTX
Benchmarking
Presentacion Benchmarking
Benchmarking
Benchmarking ppt
Decision Making Process
Benchmarking
Benchmarking
Ad

Similar to Benchmarker - A Good Friend for Performance (20)

PPT
Cinefilia Demo - EGEE User Forum 2009
PDF
Best of Breed OpenStack Compute & Block Storage Cloud... .pdf
KEY
Using Node.js to improve the performance of Mobile apps and Mobile web
PDF
Living Company vol.1 Review
PDF
Poster EWEA "Damping Estimation of an Offshore Wind Turbine on a Monopile Fou...
PDF
HTML5 on mobile
PDF
Primitives And Design Patterns for Top-Down SOA Implementations
PDF
Web Technologies
PDF
Cisco career certification paths
PDF
HTML5 for Designers (HTML5 時代の Web デザイナーの新常識)
PDF
[A3]deview 2012 network binder
PDF
Connections and Ports in ESX / ESXi
PDF
REST: putting the web back in to web services
PDF
[D1]deview 2012 nvidia
PDF
080811
PPTX
Viedome Presentation Eu
PDF
Hive at Last.fm
PDF
Teaching Computational Thinking Through Scratch Programming 2
PDF
Agile in Practice
PDF
Bitocast - A hybrid BitTorrent and IP Multicast content distribution solution
Cinefilia Demo - EGEE User Forum 2009
Best of Breed OpenStack Compute & Block Storage Cloud... .pdf
Using Node.js to improve the performance of Mobile apps and Mobile web
Living Company vol.1 Review
Poster EWEA "Damping Estimation of an Offshore Wind Turbine on a Monopile Fou...
HTML5 on mobile
Primitives And Design Patterns for Top-Down SOA Implementations
Web Technologies
Cisco career certification paths
HTML5 for Designers (HTML5 時代の Web デザイナーの新常識)
[A3]deview 2012 network binder
Connections and Ports in ESX / ESXi
REST: putting the web back in to web services
[D1]deview 2012 nvidia
080811
Viedome Presentation Eu
Hive at Last.fm
Teaching Computational Thinking Through Scratch Programming 2
Agile in Practice
Bitocast - A hybrid BitTorrent and IP Multicast content distribution solution
Ad

More from kwatch (20)

PDF
How to make the fastest Router in Python
PDF
Migr8.rb チュートリアル
PDF
なんでもID
PDF
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
PDF
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
PDF
O/Rマッパーによるトラブルを未然に防ぐ
PDF
正規表現リテラルは本当に必要なのか?
PDF
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
PDF
DBスキーマもバージョン管理したい!
PDF
PHPとJavaScriptにおけるオブジェクト指向を比較する
PDF
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
PDF
Fantastic DSL in Python
PDF
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
PDF
PHP5.5新機能「ジェネレータ」初心者入門
PDF
Pretty Good Branch Strategy for Git/Mercurial
PDF
Oktest - a new style testing library for Python -
PDF
文字列結合のベンチマークをいろんな処理系でやってみた
PDF
I have something to say about the buzz word "From Java to Ruby"
PDF
Cより速いRubyプログラム
PDF
Javaより速いLL用テンプレートエンジン
How to make the fastest Router in Python
Migr8.rb チュートリアル
なんでもID
Nippondanji氏に怒られても仕方ない、配列型とJSON型の使い方
【SQLインジェクション対策】徳丸先生に怒られない、動的SQLの安全な組み立て方
O/Rマッパーによるトラブルを未然に防ぐ
正規表現リテラルは本当に必要なのか?
【公開終了】Python4PHPer - PHPユーザのためのPython入門 (Python2.5)
DBスキーマもバージョン管理したい!
PHPとJavaScriptにおけるオブジェクト指向を比較する
SQL上級者こそ知って欲しい、なぜO/Rマッパーが重要か?
Fantastic DSL in Python
What is wrong on Test::More? / Test::Moreが抱える問題点とその解決策
PHP5.5新機能「ジェネレータ」初心者入門
Pretty Good Branch Strategy for Git/Mercurial
Oktest - a new style testing library for Python -
文字列結合のベンチマークをいろんな処理系でやってみた
I have something to say about the buzz word "From Java to Ruby"
Cより速いRubyプログラム
Javaより速いLL用テンプレートエンジン

Benchmarker - A Good Friend for Performance