[#29911] [Bug #3231] Digest Does Not Build — Charlie Savage <redmine@...>

Bug #3231: Digest Does Not Build

19 messages 2010/05/01

[#29920] [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless — Benoit Daloze <redmine@...>

Feature #3232: Loops (while/until) should return last statement value if any, like if/unless

9 messages 2010/05/01

[#29997] years in Time.utc — Xavier Noria <fxn@...>

Does anyone have a precise statement about the years supported by

13 messages 2010/05/04

[#30010] [Bug #3248] extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly — Luis Lavena <redmine@...>

Bug #3248: extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly

9 messages 2010/05/05

[#30226] [Bug #3288] Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88 — Szymon Jeż <redmine@...>

Bug #3288: Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88

10 messages 2010/05/13

[#30358] tk doesn't startup well in doze — Roger Pack <rogerdpack2@...>

Currently with 1.9.x and tk 8.5,the following occurs

12 messages 2010/05/22

[ruby-core:30219] [Bug #1560] multi core operations are slower on trunk (possible regression)

From: Yusuke Endoh <redmine@...>
Date: 2010-05-13 17:16:52 UTC
List: ruby-core #30219
Issue #1560 has been updated by Yusuke Endoh.


Hi,

> I think it would be nice for this to be fixed before 1.9.2 is released.
> Any objections to reopening this or should I open a new ticket?

Sorry for late response, but I object.

We should not call Time.new in busy loop if performance is needed.
In this case, you want to use timeout.  It can run much faster
(about 15-20 times), even if you use 1.9.1:

  +------------+----------+---------+
  |            |   1.9.1  |   trunk |
  +------------+----------+---------+
  |original.rb |  3711882 |  3572907|
  |timeout.rb  | 59852485 | 76665074|
  +------------+----------+---------+


  # timeout.rb

  require 'thread'
  require 'timeout'
  threads = []
  counter = 0
  mutex = Mutex.new

  4.times do
    threads << Thread.new {
      x=0
      y=0
      time=Time.new

      begin
        Timeout.timeout(10) do
          while true do
            x=1.00/24000000000.001
            y+=1
          end
        end
      rescue Timeout::Error
      end
      mutex.synchronize { counter+=y.to_i }
    }
  end
  threads.each { |t| t.join }

  puts "Total number of insane floating point divisions in 10 seconds is "+counter.to_s

-- 
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1560

----------------------------------------
http://redmine.ruby-lang.org

In This Thread