On Oct 28, 2007, at 12:04 AM, Charles Oliver N. wrote:
locate tests.
Couldn’t test/unit define an inherited() hook and locate test cases
that way? I haven’t looked at the code, but it seems like that could
work.
James Edward G. II
On Oct 28, 2007, at 12:04 AM, Charles Oliver N. wrote:
locate tests.
Couldn’t test/unit define an inherited() hook and locate test cases
that way? I haven’t looked at the code, but it seems like that could
work.
James Edward G. II
Lionel B. wrote:
1.8.5 3876 java (-O) 36.917 27087
1.8.5 3876 java (-O -J-server) 15.194 65815The first is the system installed ruby.
IIRC on my Gentoo I got +80% on this particular benchmark with
USE="-threads". Given this huge difference I looked at the speedup for
the test suite of one of my Rails applications and got only ~ +10%.
[…]
Now I recompiled ruby without threads:
Ruby Patch Platform Seconds Iterations/s
===== ===== ============================ ========= ============
1.8.6 111 i686-linux (gentoo) 32.801483 30486
1.8.6 111 i686-linux (gentoo -threads) 15.776961 63383
Wow, that’s better. Since I only have a few packages compiled
with threads, I try to recompile them without.
Daniel
James Edward G. II wrote:
In general, the tricky bit is that there’s at least one key library
in stdlib that depends on ObjectSpace: test/unit, which uses it to
locate tests.Couldn’t test/unit define an inherited() hook and locate test cases
that way? I haven’t looked at the code, but it seems like that could
work.James Edward G. II
Yes, it’s very easy to do so. In fact, it’s so easy that I implemented
it a few months back:
Ola Bini: Programming Language Synchronicity: ObjectSpace: to have or not to have
I didn’t integrate it with test/unit at that point, but it should be
easy-easy to do.
Cheers
–
Ola B. (http://ola-bini.blogspot.com)
JRuby Core Developer
Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
Practical JRuby on Rails (http://apress.com/book/view/9781590598818)
“Yields falsehood when quined” yields falsehood when quined.
Ola B. wrote:
I didn’t integrate it with test/unit at that point, but it should be
easy-easy to do.
I think Ryan D. (current test/unit maintainer) would probably like to
have that patch. Send it his way.
Followup, with the newly released 1.8.6p100
robert-mcgoverns-computer:~/Documents/Programming robertmcgovern$ ruby test.rb
55Ruby 1.8.6 patch 110 on i686-darwin8.10.1
It took 9.955669 seconds to run. 100445 iterations persecond.Slightly slower, running on battery but I don’t think it makes any difference.
A followup on myself now that Leopard is out and installed on my
MacBook.
On AC, with Normal performance selected the results are:
Ruby 1.8.6 patch 36 on universal-darwin9.0
It took 12.038167 seconds to run. 83069 iterations persecond.
On AC, with Better Performance selected:
Ruby 1.8.6 patch 36 on universal-darwin9.0
It took 12.112343 seconds to run. 82560 iterations persecond.
On Battery, Better Battery Life:
Ruby 1.8.6 patch 36 on universal-darwin9.0
It took 12.095676 seconds to run. 82674 iterations persecond.
On Battery, Better Performance:
Ruby 1.8.6 patch 36 on universal-darwin9.0
It took 12.10441 seconds to run. 82614 iterations persecond.
So roughly 3 seconds slower overall for Leopards own 1.8.6 vs hand
built 1.8.6 on Tiger. Need to build my own 1.8.6 on Leopard to see
what that brings. Also no real difference between various settings
(wasn’t sure if any noticeable CPU throttling would occur).
On Sep 20, 4:49 pm, SpringFlowers AutumnMoon
[email protected] wrote:
How fast does your Ruby run?
How fast does my Ruby run?! You’ve never heard of The Millenium Ruby?
It’s the version that made the GNU/Kessel run in less than 12
parsecs!
It’s run faster than Imperial programming languages. Not the local
bulk Java installs, mind you. I’m talking the big MS C# installs.
She’s fast enough for you, old man.
Regards,
Dan
On Oct 28, 2007, at 1:33 PM, Daniel B. wrote:
How fast does my Ruby run?! You’ve never heard of The Millenium Ruby?
It’s the version that made the GNU/Kessel run in less than 12
parsecs!It’s run faster than Imperial programming languages. Not the local
bulk Java installs, mind you. I’m talking the big MS C# installs.She’s fast enough for you, old man.
touche´
on a 1.86GHz Intel Core 2 Duo CPU (Intel 6320) running Win XP:
Ruby 1.9.1 patch 0 on i386-mswin32
It took 5.9375 seconds to run. 168421 iterations per second.
windows xp. intel core2 1.86GHz
JRUBY:
C:\jruby\jruby-trunk\bin>jruby calculate.rb
55It took 41.125 seconds to run. 24316 iterations per
second.Not so good. Let’s disable ObjectSpace:
C:\jruby\jruby-trunk\bin>jruby -O calculate.rb
55It took 11.109 seconds to run. 90017 iterations per
second.That was good. Now let’s give it some more juice:
C:\jruby\jruby-trunk\bin>jruby -J-server -O calculate.rb
55It took 5.75 seconds to run. 173913 iterations per
second.MRI:One-Click
ruby calculate.rb
55Ruby 1.8.6 patch 0 on i386-mswin32
It took 15.828 seconds to run. 63179 iterations per
second.
#testing 1.9, yep it’s fast;
C:\cygwin\ruby1.9\bin>ruby calculate.rb
55
Ruby 1.9.0 patch 0 on i386-cygwin
It took 3.847 seconds to run. 259942 iterations per
second.
Program changed a little:
n = 3_000_000
start_time = Time.now
t = 0
1.upto(n) do |i|
t = (1…10).inject {|x, y| x + y }
end
finish_time = Time.now
p t
puts
RUBY_VERSION ||= “unknown version”
RUBY_PATCHLEVEL ||= “unknown patchlevel”
RUBY_PLATFORM ||= “unknown platform”
print "Ruby ", RUBY_VERSION, " patch ", RUBY_PATCHLEVEL, " on ",
RUBY_PLATFORM
puts
print “It took #{finish_time - start_time} seconds to run.”
print " #{(n / (finish_time - start_time)).to_i} iterations per
second.\n"
D:>ruby calc.rb
55
Ruby 1.9.1 patch 378 on i386-mingw32
It took 6.414366 seconds to run. 467700 iterations per second.
Dell with Intel Quad Core Q6600
=================================================================
C:>ruby19\bin\ruby.exe calc.rb
55
Ruby 1.9.1 patch 378 on i386-mingw32
It took 5.289302 seconds to run. 567182 iterations per second.
Dell with Intel i7 920, 2.67GHz
the same machine, but using Ruby 1.8.7:
Ruby 1.8.7 patch 249 on i386-mingw32
It took 20.26816 seconds to run. 148015 iterations per second.
On Sun, Jun 6, 2010 at 6:21 AM, Jian L. [email protected]
wrote:
RUBY_PLATFORM
Ruby 1.9.1 patch 378 on i386-mingw32
It took 5.289302 seconds to run. 567182 iterations per second.
$rvm list
rvm rubies
jruby-1.4.0 [ [x86_64-java] ]
jruby-1.5.0 [ [x86_64-java] ]
macruby-0.6 [ x86_64 ]
rbx-head [ x86_64 ]
ruby-1.8.6-p399 [ x86_64 ]
ruby-1.8.7-p174 [ x86_64 ]
ruby-1.8.7-p249 [ x86_64 ]
ruby-1.9.1-p378 [ x86_64 ]
ruby-1.9.2-preview3 [ x86_64 ]
$ rvm use 1.8.7-p249
info: Using ruby 1.8.7 p249
$ ruby calc.rb
Ruby 1.8.7 patch 249 on i686-darwin10.3.0
It took 22.411302 seconds to run. 133861 iterations per second.
$ rvm use 1.9.1
info: Using ruby 1.9.1 p378
$ ruby calc.rb
Ruby 1.9.1 patch 378 on i386-darwin10.3.0
It took 4.696109 seconds to run. 638826 iterations per second.
$ rvm use jruby
info: Using jruby 1.5.0
$ ruby calc.rb
Ruby 1.8.7 patch 249 on java
It took 9.12 seconds to run. 328947 iterations per second.
$ rvm use macruby
info: Using macruby 0.6
$ ruby calc.rb
Ruby 1.9.0 patch 0 on universal-darwin10.0
It took 5.059672 seconds to run. 592923 iterations per second.
$ rvm use rbx-head
info: Using rbx head
$ ruby -v
rubinius 1.0.0 (1.8.7 32151bb2 2010-05-14 JI)
[x86_64-apple-darwin10.3.0]
$ ruby calc.rb
Ruby 1.8.7 patch 174 on x86_64-apple-darwin10.3.0
It took 19.90644 seconds to run. 150704 iterations per second.
$ruby calc.rb
Ruby 1.8.7 patch 174 on x86_64-apple-darwin10.3.0
It took 19.840837 seconds to run. 151203 iterations per second.
Results are interesting, I still use 1.8.7 most of the time, because,
regardless of what this test says, the only time I ever notice the speed
of
my Ruby is when I am running specs or rake tasks and 1.8.7 runs them
noticeably faster (than 1.9.1, at least. I should try with some of the
others, but since my last rvm update, I just seem to be having a lot of
trouble with gems and versions).
My Rubinius result seems unlikely to be an accurate reflection of that
project, I thought the first time you run it it takes a long time b/c it
has
to compile bytecode, then after that, it uses the bytecode, and is much
quicker. But it took just as long both times. I scanned their
getting_started, and FAQ, and didn’t see anything to suggest I am doing
it
wrong, so IDK. Perhaps I misunderstand the project, or need to optimize
rbx
by hand rather than letting rvm deal with it.
On Sun, Oct 28, 2007 at 9:33 PM, Daniel B. [email protected]
wrote:
On Sep 20, 4:49 pm, SpringFlowers AutumnMoon
[email protected] wrote:How fast does your Ruby run?
How fast does my Ruby run?! You’ve never heard of The Millenium Ruby?
It’s the version that made the GNU/Kessel run in less than 12
parsecs!It’s run faster than Imperial programming languages. Not the local
bulk Java installs, mind you. I’m talking the big MS C# installs.
Actually it runs slower than those, but it seems faster because the
others normally depart when the Millenium Ruby has already arrived.
Well depends on the pilot too.
R.
On Jun 6, 2010, at 6:21 AM, Jian L. wrote:
Program changed a little:
Someone is going to point this out sooner or later so it may as well be
me.
Your “benchmark” doesn’t test Ruby performance. It tests the performance
of the Enumerable#inject method. Each runtime will have different
results for running that one method but you can’t really draw any
conclusions about overall runtime performance. It’s a micro-benchmark
without a lot of usefulness.
cr
Chuck R. wrote:
On Jun 6, 2010, at 6:21 AM, Jian L. wrote:
Program changed a little:
Someone is going to point this out sooner or later so it may as well be
me.Your “benchmark” doesn’t test Ruby performance. It tests the performance
of the Enumerable#inject method. Each runtime will have different
results for running that one method but you can’t really draw any
conclusions about overall runtime performance. It’s a micro-benchmark
without a lot of usefulness.
It is just to get an idea, really.
How comprehensive do you expect the benchmark to be when the test is
only 2 nested loops in 3 lines?
Jian L. wrote:
How fast does your Ruby run?
I got 53648 iterations per second running the following program,
on an Intel 3.2 GHz HT, Win XP machine:
C:> ruby calculate.rb
55Ruby 1.8.6 patch 0 on i386-mswin32
It took 18.64 seconds to run. 53648 iterations per second.
Running the original code:
Ruby 1.9.1 patch 378 on x86_64-linux
It took 1.277456379 seconds to run. 782805 iterations per second.
Compiled on a Phenom II X4 955 with gcc 4.4.1 with -O3 -mtune=native
OS: Ubuntu 9.10
My goodness, Ruby has come a long way… 12 times as fast as I made the
original post. On a Mac Mini I got last year about summer, running Ruby
2.0, I got 705016 iterations per second:
ruby cal.rb
55
Ruby 2.0.0 patch 247 on x86_64-darwin12.4.0
It took 1.418407 seconds to run. 705016 iterations per second.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs