| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Ruby 1.8.6 OneClick Installer | Ruby 1.8.6 RubyInstaller - custom built | Ruby 1.8.6 MinGW custom built | Ruby 1.8.6 MSVC custom built | Ruby 1.8.7 MinGW custom built | Ruby 1.8.7 MSVC custom built | Ruby 1.9.1 MinGW custom built | Ruby 1.9.1 MSVC custom built | JRuby 1.1.6 Java 6 custom built | JRuby 1.1.6 Java 6 custom built with --server flag | Ruby 1.8.6 Cygwin custom built | Ruby 1.8.7 Cygwin custom built | Ruby 1.9.1 Cygwin custom built | ||||||||
2 | WEBrick - requests/second (mean) - ab -n 500 -c 10 http://127.0.0.1:9292/ | 12.82 | 12.45 | 12.43 | 12.49 | 3.4 | 3.42 | 11.48 | 11.94 | 22.39 | 16.95 | 11.34 | 11.35 | 11.2 | |||||||
3 | bench_pythag.rb (JRuby repo) best of the 3 runs | 48.296 | 35.672 | 31.906 | 39.782 | 32.734375 | 35.828125 | 31.71875 | 33.9375 | 24.355137 | 19.088785 | 29.748 | 29.516 | 29.328 | |||||||
4 | bench_fractal.rb (JRuby repo with output (puts) commented out) best of 5 runs | 15.172 | 10.11 | 9.797 | 10.281 | 9.875 | 10.640625 | 5.75 | 5.671875 | 3.885818 | 3.219289 | 9.806 | 10.409 | 5.338 | |||||||
5 | bench_float_math.rb (JRuby repo, edited to add Benchmark.measure block) | 279.625 | 184.734 | 176.61 | 197.39 | 179.9375 | 195.375 | 175.40625 | 158.640625 | 125.894525 | 103.436342 | 190.71 | 193.747 | 164.771 | |||||||
6 | Mongrel - requests/second (mean) - ab -n 10000 -c 100 http://127.0.0.1:9292/ | 313.57 | 347.45 | 357.14 | 326.7 | 274.68 | 232.39 | (crash when starting up) | (error when building gem) | 71.24 | 62.22 | 15.51 | 15.37 | (error when building gem) | |||||||
7 | |||||||||||||||||||||
8 | |||||||||||||||||||||
9 | |||||||||||||||||||||
10 | -v (version) | ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mingw32] | ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mingw32] | ruby 1.8.6 (2008-03-03 patchlevel 114) [i386-mswin32_90] | ruby 1.8.7 (2008-11-27 revision 0) [i386-mingw32] | ruby 1.8.7 (2008-11-27 revision 0) [i386-mswin32_90] | ruby 1.9.1 (2008-11-29 revision 20393) [i386-mingw32] | ruby 1.9.1 (2008-11-29 revision 20393) [i386-mswin32_90] | jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-28 rev ) [x86-java] | jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-28 rev ) [x86-java] | ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-cygwin] | ruby 1.8.7 (2008-11-27 revision 0) [i386-cygwin] | ruby 1.9.1 (2008-11-29 revision 20393) [i386-cygwin] | |||||||
11 | CFLAGS - ruby.exe -rrbconfig -e "p Config::CONFIG['CFLAGS']" | -MD -Zi -O2b2xg- -G6 | -g -O2 | -pipe -O2 -mms-bitfields -march=i686 | -MD -O2b2xty- | -pipe -O2 -mms-bitfields -march=i686 -O2 -Wall -Wno-parentheses | -MD -O2b2xty- | -pipe -O2 -mms-bitfields -march=i686 -O2 -Wall -Wno-parentheses | -MD -Zi -O2b2xty- -Zm200 | -O2 -march=i686 | -O2 -march=i686 -O2 -g -Wall -Wno-parentheses | -O2 -march=i686 -O2 -Wall -Wno-parentheses | |||||||||
12 | |||||||||||||||||||||
13 | |||||||||||||||||||||
14 | gcc version 4.3.0 20080305 (alpha-testing) mingw-20080502 (GCC) | msvc 2008 - Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86 | Ruby 1.9.1 branch - r20393 | Cygwin gcc version 4.3.2 20080827 (alpha-testing) 1 (GCC) | |||||||||||||||||
15 | Source code listing: | Mongrel | bench_pythag.rb | bench_fractal.rb | bench_float_math.rb | Mongrel | |||||||||||||||
16 | require 'rubygems' require 'rack' require 'webrick' class ::WEBrick::HTTPServer def access_log(config, req, res) # nop end end class ::WEBrick::BasicLog def log(level, data) # nop end end class HelloWorld def call(env) a = [] a << 'Hello Rack!' a << Time.new a << RUBY_PLATFORM a << RUBY_VERSION [200, {'Content-Type' => ['text/html']}, [a.join('<br />')]] end end Rack::Handler::WEBrick.run HelloWorld.new, :Port => 9292 | require 'benchmark' def pythag(n) result = [] (2..n).each do |c| (1...c).each do |b| a = Math.sqrt(c*c - b*b) result << [a.to_i, b, c] if a.to_i == a end end result end 5.times { puts Benchmark.measure { pythag(5000) } } | BAILOUT = 16 MAX_ITERATIONS = 1000 class Mandelbrot def initialize #~ puts "Rendering" for y in -39...39 do #~ puts for x in -39...39 do i = iterate(x/40.0,y/40.0) #~ if (i == 0) #~ print "*" #~ else #~ print " " #~ end end end end def iterate(x,y) cr = y-0.5 ci = x zi = 0.0 zr = 0.0 i = 0 while(1) i += 1 temp = zr * zi zr2 = zr * zr zi2 = zi * zi zr = zr2 - zi2 + cr zi = temp + temp + ci return i if (zi2 + zr2 > BAILOUT) return 0 if (i > MAX_ITERATIONS) end end end (ARGV[0] || 1).to_i.times { time = Time.now Mandelbrot.new #~ puts puts "Ruby Elapsed %f" % (Time.now - time) } | require 'benchmark' puts Benchmark.measure{ total = 0.0 1.0.step(2000.0,0.0001) do |x| result = (5.4*x**5 - 3.211*x**4 + 100.3*x**2 - 100 + 20*Math.sin(x) - Math.log(x)) * 20*Math.exp(-x/100.3) total += result / 0.0001 end puts total } | require 'rubygems' require 'rack' class HelloWorld def call(env) a = [] a << 'Hello Rack!' a << Time.new a << RUBY_PLATFORM a << RUBY_VERSION [200, {'Content-Type' => ['text/html']}, [a.join('<br />')]] end end Rack::Handler::Mongrel.run HelloWorld.new, :Port => 9292 | ||||||||||||||||
17 | |||||||||||||||||||||
18 | |||||||||||||||||||||
19 | |||||||||||||||||||||
20 | |||||||||||||||||||||
21 | |||||||||||||||||||||
22 | |||||||||||||||||||||
23 | |||||||||||||||||||||
24 | |||||||||||||||||||||
25 | |||||||||||||||||||||
26 | |||||||||||||||||||||
27 | |||||||||||||||||||||
28 | |||||||||||||||||||||
29 | |||||||||||||||||||||
30 | |||||||||||||||||||||
31 | |||||||||||||||||||||
32 | |||||||||||||||||||||
33 | |||||||||||||||||||||
34 | |||||||||||||||||||||
35 | |||||||||||||||||||||
36 | |||||||||||||||||||||
37 | |||||||||||||||||||||
38 | |||||||||||||||||||||
39 | |||||||||||||||||||||
40 | |||||||||||||||||||||
41 | |||||||||||||||||||||
42 | |||||||||||||||||||||
43 | |||||||||||||||||||||
44 | |||||||||||||||||||||
45 | |||||||||||||||||||||
46 | |||||||||||||||||||||
47 | |||||||||||||||||||||
48 | |||||||||||||||||||||
49 | |||||||||||||||||||||
50 | |||||||||||||||||||||
51 | |||||||||||||||||||||
52 | |||||||||||||||||||||
53 | |||||||||||||||||||||
54 | |||||||||||||||||||||
55 | |||||||||||||||||||||
56 | |||||||||||||||||||||
57 | |||||||||||||||||||||
58 | |||||||||||||||||||||
59 | |||||||||||||||||||||
60 | |||||||||||||||||||||
61 | |||||||||||||||||||||
62 | |||||||||||||||||||||
63 | |||||||||||||||||||||
64 | |||||||||||||||||||||
65 | |||||||||||||||||||||
66 | |||||||||||||||||||||
67 | |||||||||||||||||||||
68 | |||||||||||||||||||||
69 | |||||||||||||||||||||
70 | |||||||||||||||||||||
71 | |||||||||||||||||||||
72 | |||||||||||||||||||||
73 | |||||||||||||||||||||
74 | |||||||||||||||||||||
75 | |||||||||||||||||||||
76 | |||||||||||||||||||||
77 | |||||||||||||||||||||
78 | |||||||||||||||||||||
79 | |||||||||||||||||||||
80 | |||||||||||||||||||||
81 | |||||||||||||||||||||
82 | |||||||||||||||||||||
83 | |||||||||||||||||||||
84 | |||||||||||||||||||||
85 | |||||||||||||||||||||
86 | |||||||||||||||||||||
87 | |||||||||||||||||||||
88 | |||||||||||||||||||||
89 | |||||||||||||||||||||
90 | |||||||||||||||||||||
91 | |||||||||||||||||||||
92 | |||||||||||||||||||||
93 | |||||||||||||||||||||
94 | |||||||||||||||||||||
95 | |||||||||||||||||||||
96 | |||||||||||||||||||||
97 | |||||||||||||||||||||
98 | |||||||||||||||||||||
99 | |||||||||||||||||||||
100 |