Ruby 2.0.0 quick performance test

I was just working on my Lucy project when I got the news on Twitter the Ruby 2.0 was released. I thought I test the improved require implementation.

I followed the instructions of Eric Wendelin to install Ruby 2.0:

https://coderwall.com/p/tptocq

Result:

ruby-1.9.2-p320

1
2
3
4
5
6
7
8
9
10
11
$ time rake
Run options: --seed 12947
 
# Running tests:
 
..................S
 
Finished tests in 0.005716s, 3324.0028 tests/s, 4548.6354 assertions/s.
 
19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  0.60s user 0.27s system 98% cpu 0.893 total
$ time rake
Run options: --seed 12947

# Running tests:

..................S

Finished tests in 0.005716s, 3324.0028 tests/s, 4548.6354 assertions/s.

19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  0.60s user 0.27s system 98% cpu 0.893 total

ruby-1.9.3-p392:

1
2
3
4
5
6
7
8
9
10
11
$ time rake
Run options: --seed 18928
 
# Running tests:
 
..................S
 
Finished tests in 0.006194s, 3067.4847 tests/s, 4197.6106 assertions/s.
 
19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  2.16s user 0.26s system 94% cpu 2.559 total
$ time rake
Run options: --seed 18928

# Running tests:

..................S

Finished tests in 0.006194s, 3067.4847 tests/s, 4197.6106 assertions/s.

19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  2.16s user 0.26s system 94% cpu 2.559 total

ruby-2.0.0-p0:

1
2
3
4
5
6
7
8
9
10
11
$ time rake
Run options: --seed 58083
 
# Running tests:
 
..................S
 
Finished tests in 0.005765s, 3295.7502 tests/s, 4509.9740 assertions/s.
 
19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  0.49s user 0.09s system 87% cpu 0.667 total
$ time rake
Run options: --seed 58083

# Running tests:

..................S

Finished tests in 0.005765s, 3295.7502 tests/s, 4509.9740 assertions/s.

19 tests, 26 assertions, 0 failures, 0 errors, 1 skips
rake  0.49s user 0.09s system 87% cpu 0.667 total

It’s not a big complex application, but I feel much improvement to 1.9.3 and 1.9.2 looks quicker.

Thanks Ruby and Happy 20th birthday to you!