[#49993] メソッド呼び出し時の引数の値を VM 側で取得する方法について — Tetsuo Handa <penguin-kernel@...>
初めまして。 Linux カーネルプログラマの熊猫と申します。
12 messages
2017/02/28
[#49995] Re: メソッド呼び出し時の引数の値を VM 側で取得する方法について
— SASADA Koichi <ko1@...>
2017/02/28
On 2017/02/28 14:06, Tetsuo Handa wrote:
[#49997] Re: メソッド呼び出し時の引数の値を VM 側で取得する方法について
— Tetsuo Handa <penguin-kernel@...>
2017/02/28
SASADA Koichi さんは書きました:
[#49999] Re: メソッド呼び出し時の引数の値を VM 側で取得する方法について
— SASADA Koichi <ko1@...>
2017/02/28
On 2017/02/28 14:53, Tetsuo Handa wrote:
[#50000] Re: メソッド呼び出し時の引数の値を VM 側で取得する方法について
— Tetsuo Handa <penguin-kernel@...>
2017/03/01
SASADA Koichi さんは書きました:
[ruby-dev:49984] [Ruby trunk Bug#13228] s[i]=c(assigning a character) for String is slower than Array on Linux
From:
yoshiokatsuneo@...
Date:
2017-02-18 14:37:04 UTC
List:
ruby-dev #49984
Issue #13228 has been reported by Tsuneo Yoshioka.
----------------------------------------
Bug #13228: s[i]=c(assigning a character) for String is slower than Array on Linux
https://bugs.ruby-lang.org/issues/13228
* Author: Tsuneo Yoshioka
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
s[i]=c(assigning a character) for String is slower than for Array on Linux.
If I split the String to Array, and assign characters, and join the Array to String,
then it is much faster than assigning characters directly to the string.
Somehow, I don't see the performance difference on Mac OS X.
~$ time ruby -e 'N=100000; s="a"*N; N.times{s[Random.rand(N)]="Z"}; puts s' >/dev/null
real 0m0.879s
user 0m0.836s
sys 0m0.012s
~$ time ruby -e 'N=100000;s="a"*N;s=s.split(""); N.times{s[Random.rand(N)]="Z"}; puts s.join("")' >/dev/null
real 0m0.153s
user 0m0.108s
sys 0m0.016s
~$ uname -a
Linux aaaaaaaa 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
~$ ruby --version
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
--
https://bugs.ruby-lang.org/