ABCDEFGHIJKLMNOPQRSTU
1
Ruby 1.8.6 OneClick InstallerRuby 1.8.6 RubyInstaller - custom builtRuby 1.8.6 MinGW custom builtRuby 1.8.6 MSVC custom builtRuby 1.8.7 MinGW custom builtRuby 1.8.7 MSVC custom builtRuby 1.9.1 MinGW custom builtRuby 1.9.1 MSVC custom builtJRuby 1.1.6 Java 6 custom builtJRuby 1.1.6 Java 6 custom built with --server flagRuby 1.8.6 Cygwin custom builtRuby 1.8.7 Cygwin custom builtRuby 1.9.1 Cygwin custom built
2
WEBrick - requests/second (mean) - ab -n 500 -c 10 http://127.0.0.1:9292/ 12.8212.4512.4312.493.43.4211.4811.9422.3916.9511.3411.3511.2
3
bench_pythag.rb (JRuby repo) best of the 3 runs48.29635.67231.90639.78232.73437535.82812531.7187533.937524.35513719.08878529.74829.51629.328
4
bench_fractal.rb (JRuby repo with output (puts) commented out) best of 5 runs15.17210.119.79710.2819.87510.6406255.755.6718753.8858183.2192899.80610.4095.338
5
bench_float_math.rb (JRuby repo, edited to add Benchmark.measure block)279.625184.734176.61197.39179.9375195.375175.40625158.640625125.894525103.436342190.71193.747164.771
6
Mongrel - requests/second (mean) - ab -n 10000 -c 100 http://127.0.0.1:9292/ 313.57347.45357.14326.7274.68232.39(crash when starting up)(error when building gem)71.2462.2215.5115.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 80x86Ruby 1.9.1 branch - r20393Cygwin gcc version 4.3.2 20080827 (alpha-testing) 1 (GCC)
15
Source code listing:Mongrelbench_pythag.rbbench_fractal.rbbench_float_math.rbMongrel
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