<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;[[Home]] (English)&lt;/p&gt;
&lt;h1&gt;BenchmarkX&lt;/h1&gt;
&lt;p&gt;BenchmarkX &#12399;&#12289;&#36890;&#24120;&#12398;Benchmark&#12514;&#12472;&#12517;&#12540;&#12523;&#12434;&#25313;&#24373;&#12375;&#12390;&#12289;&#12381;&#12398;&#32080;&#26524;&#12434;&amp;quot;Gruff&amp;quot;:http://nubyonrails.com/pages/gruff &#12434;&#29992;&#12356;&#12383;&#32654;&#12375;&#12356;&#12464;&#12521;&#12501;&#12392;&#12375;&#12390;&#20986;&#21147;&#12377;&#12427;&#12383;&#12417;&#12398;&#12521;&#12452;&#12502;&#12521;&#12522;&#12391;&#12377;&#12290;&lt;/p&gt;
&lt;h2&gt;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&lt;/h2&gt;
&lt;pre&gt;
&lt;code&gt;
% sudo gem install
&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;&#20351;&#12356;&#26041;&lt;/h2&gt;
&lt;p&gt;BenchmarkX &#12399;&#27161;&#28310;&#28155;&#20184;&#12398; Benchmark &#12514;&#12472;&#12517;&#12540;&#12523;(benchmark.rb) &#12392;&#12411;&#12392;&#12435;&#12393;&#21516;&#12376;&#25391;&#33310;&#12356;&#12434;&#12375;&#12414;&#12377;&#12290;&lt;/p&gt;
&lt;pre&gt;
&lt;code syntax=&quot;ruby&quot;&gt;
require &quot;benchmarkx&quot;

BenchmarkX.bm |x| do
    # &#12464;&#12521;&#12501;&#12398;&#12501;&#12449;&#12452;&#12523;&#21517;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;
    x.filename = &quot;graph.png&quot;
    # &#12464;&#12521;&#12501;&#12398;&#38988;&#21517;&#12434;&#35373;&#23450;&#12375;&#12414;&#12377;
    x.gruff.title = &quot;#{n} times iterations of `a = \&quot;1\&quot;'&quot;
    x.report(&quot;for:&quot;)   {for i in 1..n; a = &quot;1&quot;; end} # Benchmark::measure
    x.report(&quot;times:&quot;) {n.times do   ; a = &quot;1&quot;; end}
    x.report(&quot;upto:&quot;)  {1.upto(n) do ; a = &quot;1&quot;; end}
end
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;&#12371;&#12398;&#12505;&#12531;&#12481;&#12510;&#12540;&#12463;&#32080;&#26524;&#12399;&#27425;&#12398;&#12424;&#12358;&#12394;&#12464;&#12521;&#12501;&#12392;&#12394;&#12426;&#12414;&#12377;&#12290;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2347/2406591389_45367d4d2f.jpg&quot; title=&quot;generated by BenchmarkX 001&quot; alt=&quot;generated by BenchmarkX 001&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&#12414;&#12383;&#27161;&#28310;&#20986;&#21147;&#12395;&#36890;&#24120;&#12398;&#12486;&#12461;&#12473;&#12488;&#29256;&#12398;&#32080;&#26524;&#12434;&#34920;&#31034;&#12375;&#12414;&#12377;&#12290;&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
50000 times iterations of `a = &quot;1&quot;'
             user     system      total        real
for:     0.040000   0.010000   0.050000 (  0.062325)
times:   0.030000   0.000000   0.030000 (  0.049322)
upto:    0.050000   0.010000   0.060000 (  0.065992)
&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;Links&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://nubyonrails.com/pages/gruff&quot;&gt;Gruff&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;BenchmarkX
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;http://rubyforge.org/projects/benchmarkx/&quot;&gt;RubyForge&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://benchmarkx.rubyforge.org/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; document&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://github.com/keita/benchmarkx/tree/master&quot;&gt;GitHub&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2008-04-12T02:13:15-07:00</created-at>
  <id type="integer">9960</id>
  <permalink>home-ja</permalink>
  <repository-id type="integer">8835</repository-id>
  <title>Home.ja</title>
  <updated-at type="datetime">2008-04-12T02:13:15-07:00</updated-at>
  <user-id type="integer">5487</user-id>
</wiki>
