Created
June 24, 2012 00:18
-
-
Save k-yamada/2980664 to your computer and use it in GitHub Desktop.
Benchmark of JRuby start-up time with arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def test(args) | |
5.times do | |
`jruby test.rb #{args}` | |
end | |
end | |
Benchmark.bm(7) do |x| | |
x.report("default :") {test ""} | |
x.report("-X :") {test "-X"} | |
x.report("-D :") {test "-D"} | |
x.report("-32 :") {test "-32"} | |
x.report("-d32 :") {test "-d32"} | |
x.report("-X-D-32-d32 :") {test "-X-D-32-d32"} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'java' | |
puts "test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby benchmark.rb | |
user system total real | |
default : 0.010000 0.010000 13.960000 ( 9.595538) | |
-X : 0.010000 0.010000 13.790000 ( 8.985453) | |
-D : 0.000000 0.010000 13.670000 ( 8.680449) | |
-32 : 0.000000 0.010000 13.280000 ( 8.599478) | |
-d32 : 0.010000 0.000000 6.670000 ( 5.797627) | |
-X-D-32-d32 : 0.000000 0.010000 13.710000 ( 8.736142) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment