headius (owner)

Revisions

gist: 217847 Download_button fork
public
Public Clone URL: git://gist.github.com/217847.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
~/projects/jruby ➔ jruby --server -rbenchmark -rjava -e "JObject = java.lang.Object; 10.times { puts Benchmark.measure {a = []; 1_000_000.times { a << JObject.new } } }"
  1.160000 0.000000 1.160000 ( 1.078000)
  0.654000 0.000000 0.654000 ( 0.655000)
  0.687000 0.000000 0.687000 ( 0.687000)
  0.621000 0.000000 0.621000 ( 0.621000)
  0.635000 0.000000 0.635000 ( 0.635000)
  0.609000 0.000000 0.609000 ( 0.609000)
  0.625000 0.000000 0.625000 ( 0.625000)
  0.789000 0.000000 0.789000 ( 0.789000)
  0.659000 0.000000 0.659000 ( 0.659000)
  0.647000 0.000000 0.647000 ( 0.647000)
 
~/projects/jruby ➔ ../jruby-1.4.0RC1/bin/jruby --server -rbenchmark -rjava -e "JObject = java.lang.Object; 10.times { puts Benchmark.measure {a = []; 1_000_000.times { a << JObject.new } } }"
  2.612000 0.000000 2.612000 ( 2.516000)
  1.809000 0.000000 1.809000 ( 1.809000)
  1.735000 0.000000 1.735000 ( 1.735000)
  1.727000 0.000000 1.727000 ( 1.727000)
  1.719000 0.000000 1.719000 ( 1.719000)
  1.713000 0.000000 1.713000 ( 1.713000)
  1.955000 0.000000 1.955000 ( 1.955000)
  1.663000 0.000000 1.663000 ( 1.663000)
  1.656000 0.000000 1.656000 ( 1.656000)
  1.664000 0.000000 1.664000 ( 1.664000)
 
~/projects/jruby ➔ jruby -rjava -e "JObject = java.lang.Object; a = []; 1_000_000.times { a << JObject.new }; java.lang.System.gc; p java.lang.management.ManagementFactory.memory_mxbean.heap_memory_usage"
init = 0(0K) used = 47785208(46665K) committed = 66650112(65088K) max = 66650112(65088K)
 
~/projects/jruby ➔ ../jruby-1.4.0RC1/bin/jruby -rjava -e "JObject = java.lang.Object; a = []; 1_000_000.times { a << JObject.new }; java.lang.System.gc; puts java.lang.management.ManagementFactory.memory_mxbean.heap_memory_usage"
init = 0(0K) used = 106234680(103744K) committed = 189644800(185200K) max = 520290304(508096K)
 
~/projects/jruby ➔ time jruby -rjava -e "JObject = java.lang.Object; a = []; 1_000_000.times { a << JObject.new }"
real 0m2.457s
user 0m2.170s
sys 0m0.221s
 
~/projects/jruby ➔ time ../jruby-1.4.0RC1/bin/jruby -rjava -e "JObject = java.lang.Object; a = []; 1_000_000.times { a << JObject.new }"
 
real 0m4.064s
user 0m3.663s
sys 0m0.316s