Forum: Ruby-core [Open] Regression of Benchmark.realtime

Eabad423977cfc6873b8f5df62b848a6?d=identicon&s=25 unknown (Guest)
on 2014-08-30 07:57
(Received via mailing list)
Issue #10188 has been reported by Hiroshi SHIBATA.

----------------------------------------
Bug #10188: Regression of Benchmark.realtime
https://bugs.ruby-lang.org/issues/10188

* Author: Hiroshi SHIBATA
* Status: Open
* Priority: Normal
* Assignee: Eric Wong
* Category:
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-08-22 trunk 47254) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
After r47260, rubyci is sometimes failed. It seems to relate
https://bugs.ruby-lang.org/issues/10165 .

 *
http://chkbuild001.hsbt.org/chkbuild/ruby-trunk/lo...
 *
http://fb64b.rubyci.org/~chkbuild/ruby-trunk/log/2...

I investigate this on Amazon Linux 2014.3

https://gist.github.com/hsbt/2647af71d60121034c1c

In this results, ```Benchmark.realtime { sleep 0.001 }``` returns 0.01
every 10 times.

> Eric Wong

How about do you think this fail?
18813f71506ebad74179bf8c5a136696?d=identicon&s=25 Eric Wong (Guest)
on 2014-08-30 08:34
(Received via mailing list)
shibata.hiroshi@gmail.com wrote:
> I investigate this on Amazon Linux 2014.3

Is this shared machine/VM?  What kernel config/version?

Kernel config may be in /proc/config.* , otherwise distros may put
kernel config in /boot/config*

I'm mainly interested in *_HZ and preempt options.

> https://gist.github.com/hsbt/2647af71d60121034c1c
>
> In this results, ```Benchmark.realtime { sleep 0.001 }``` returns 0.01 every 10
times.

Yikes, wild timings :<

> > Eric Wong
>
> How about do you think this fail?

I think the test case is too fragile.  We should increase delta+sleep or
remove test.  Based on comments on thread_pthread.c, 0.1s might be a
lower bound on portable timing granularity.

I think this can fail on your system even with the lib/benchmark.rb
optimization in r47260 reverted.
This topic is locked and can not be replied to.