[#46329] [ruby-trunk - Feature #7252][Assigned] version number of 2.0 release — "usa (Usaku NAKAMURA)" <usa@...>

26 messages 2012/11/01

[#46350] RubySpecメンテナ — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

15 messages 2012/11/02

[#46414] [ruby-trunk - Bug #7287][Open] please rename atomic.h which conflicts with /usr/include/atomic.h in Solaris10 — "ngoto (Naohisa Goto)" <ngotogenome@...>

10 messages 2012/11/06

[#46434] トラップハンドラで許されない操作はなにか — KOSAKI Motohiro <kosaki.motohiro@...>

小崎です

9 messages 2012/11/06

[#46440] [ruby-trunk - Bug #7300][Open] Hash#[] の挙動が 1.9.3 と異なっている — "hsbt (Hiroshi SHIBATA)" <shibata.hiroshi@...>

12 messages 2012/11/07

[#46477] Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — SASADA Koichi <ko1@...>

refinement を導入するときの性能に対する excuse が「method cache に殆どあ

20 messages 2012/11/11
[#46480] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — Shugo Maeda <shugo@...> 2012/11/11

前田です。

[#46488] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — SASADA Koichi <ko1@...> 2012/11/12

 ささだです.

[#46491] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — Shugo Maeda <shugo@...> 2012/11/12

前田です。

[#46493] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — SASADA Koichi <ko1@...> 2012/11/12

 ささだです.

[#46495] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — Shugo Maeda <shugo@...> 2012/11/12

前田です。

[#46497] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — SASADA Koichi <ko1@...> 2012/11/12

(2012/11/12 18:20), Shugo Maeda wrote:

[#46501] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — Shugo Maeda <shugo@...> 2012/11/12

前田です。

[#46513] Re: Fwd: [ruby-changes:25559] shugo:r37616 (trunk): * vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo): — Nobuyoshi Nakada <nobu@...> 2012/11/14

なかだです。

[#46509] [ruby-trunk - Bug #7344][Open] gem pristine bigdecimal が失敗してしまう — "hsbt (Hiroshi SHIBATA)" <shibata.hiroshi@...>

31 messages 2012/11/13

[#46520] [ruby-trunk - Bug #7356][Open] ruby-2.0.0-preview1 で adlint-2.6.10 が性能劣化 — "yanoh (Yutaka Yanoh)" <yutaka@...>

11 messages 2012/11/15

[#46647] [ruby-trunk - Bug #7452][Assigned] Main thread is stopped after running finalizers if the main thread has a finalizer — "mrkn (Kenta Murata)" <muraken@...>

8 messages 2012/11/28

[ruby-dev:46657] [ruby-trunk - Bug #7356][Feedback] ruby-2.0.0-preview1 で adlint-2.6.10 が性能劣化

From: "wanabe (_ wanabe)" <s.wanabe@...>
Date: 2012-11-28 15:33:36 UTC
List: ruby-dev #46657
Issue #7356 has been updated by wanabe (_ wanabe).

File r37410-adapted37582-partially.patch added
File r37410-revert34948-partially.patch added
Status changed from Assigned to Feedback

横からすみません。adlint-benchmark 使わせていただきました。
git bisect で調べてみたのですが、r34948 で rb_ary_push_m() が
rb_ary_cat() を呼び出すように変更されているのが性能劣化の原因ではないでしょうか。
また、r37582 でその rb_ary_cat() の内容が変更されたため、再度性能が回復しているように見えます。
実験的に r34948 の関連する部分を revert するパッチと、r37582 の関連する部分を適用する二つのパッチを書きました。
r34948 ~ r37581 の間で、どちらのパッチを用いても速度が改善されると思われます。
チケット起票時に使われた r37410 (でいいのでしょうか? r37411 は見つかりませんでした)を使って確認しました。
yanoh さん、よろしければご確認いただけますでしょうか。
最後に実験結果を示します。参考にしていただければ幸いです
長々と書きましたが、r37582 以降 trunk で性能劣化はないのではないか、と思います。
(本題から逸れるので調べませんでしたが、むしろ r37410 ~ r37581 の間でも
 何らかの性能改善があったように見受けられます。)

* ruby 1.9.3p327 (2012-11-10 revision 37605)
                                   user     system      total        real
screen-4.0.3/process.c.small  26.880000   0.100000  26.980000 ( 27.002153)
  27.470s user, 0.130s system, 00:00:27.59 total

* trunk r34947
                                   user     system      total        real
screen-4.0.3/process.c.small  27.500000   0.120000  27.620000 ( 27.645960)
  28.120s user, 0.180s system, 00:00:28.30 total

* trunk r34948
                                   user     system      total        real
screen-4.0.3/process.c.small  33.080000   0.190000  33.270000 ( 33.382366)
  33.730s user, 0.220s system, 00:00:33.94 total

* trunk r37581
                                   user     system      total        real
screen-4.0.3/process.c.small  25.910000   0.140000  26.050000 ( 26.057930)
  26.550s user, 0.190s system, 00:00:26.74 total

* trunk r37582
                                   user     system      total        real
screen-4.0.3/process.c.small  21.480000   0.130000  21.610000 ( 21.608838)
  22.090s user, 0.190s system, 00:00:22.28 total

* trunk r37410
                                   user     system      total        real
screen-4.0.3/process.c.small  33.690000   0.100000  33.790000 ( 33.858404)
  34.360s user, 0.140s system, 00:00:34.50 total

* trunk r37410 with r37410-revert34948-partially.patch
                                   user     system      total        real
screen-4.0.3/process.c.small  26.710000   0.120000  26.830000 ( 26.879693)
  27.390s user, 0.160s system, 00:00:27.55 total

* trunk r37410 with r37410-adapted37582.patch
                                   user     system      total        real
screen-4.0.3/process.c.small  26.830000   0.100000  26.930000 ( 27.078610)
  27.490s user, 0.140s system, 00:00:27.62 total

----------------------------------------
Bug #7356: ruby-2.0.0-preview1 で adlint-2.6.10 が性能劣化
https://bugs.ruby-lang.org/issues/7356#change-34087

Author: yanoh (Yutaka Yanoh)
Status: Feedback
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: 
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-01 trunk 37411) [i686-linux]


== 現象

ruby-1.9.3-p327 と ruby-2.0.0-preview1 で adlint-2.6.10 の性能比較を行った結果、
ruby-2.0.0-preview1 の方が解析時間が 1.2 倍ほど長くかかりました。

== 再現手順

 % gem install adlint
 % tar xvjf adlint-benchmark-screen.tar.bz2  <- 添付ファイル
 % cd adlint-benchmark-screen/adlint
 % time make -j 2 2>/dev/null

== 性能測定結果

=== 測定環境

* Core 2 Duo E4500 2.20GHz / 3.4GB
* Fedora 14 / Linux 2.6.35.14-106.fc14.i686

=== 測定方法

* 下記バージョンの ruby を用いて、adlint-2.6.10 で screen-4.0.3 を解析
  ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]  built with gcc-4.5.1
  ruby 2.0.0dev (2012-11-01 trunk 37411) [i686-linux]      built with gcc-4.5.1
  ruby 2.0.0dev (2012-11-01 trunk 37411) [i686-linux]      built with gcc-4.7.2

* すべて configure オプションは --prefix のみ

* 解析は 2 コアを使い切れるよう make -j 2 を指定

* できるだけ IO による遅延を抑えるため標準エラーは /dev/null へリダイレクト
  ただし解析結果ファイルの出力は抑止できていません

=== 測定結果

* ruby 1.9.3p327 (2012-11-10 revision 37606) [i686-linux]  built with gcc-4.5.1
  make -j 2 2> /dev/null  1335.85s user 7.10s system 184% cpu 12:07.79 total
  make -j 2 2> /dev/null  1336.54s user 7.17s system 184% cpu 12:07.80 total
  make -j 2 2> /dev/null  1340.71s user 7.23s system 184% cpu 12:10.69 total

* ruby 2.0.0dev (2012-11-01 trunk 37411) [i686-linux]      built with gcc-4.5.1
  make -j 2 2> /dev/null  1626.45s user 8.08s system 184% cpu 14:48.20 total
  make -j 2 2> /dev/null  1633.40s user 8.10s system 185% cpu 14:46.92 total
  make -j 2 2> /dev/null  1631.37s user 7.86s system 184% cpu 14:50.18 total

* ruby 2.0.0dev (2012-11-01 trunk 37411) [i686-linux]      built with gcc-4.7.2
  make -j 2 2> /dev/null  1531.83s user 7.85s system 184% cpu 13:53.04 total
  make -j 2 2> /dev/null  1533.46s user 7.97s system 184% cpu 13:54.54 total
  make -j 2 2> /dev/null  1532.89s user 8.03s system 184% cpu 13:53.33 total

== 備考

adlint_sma コマンドは、最初のソースコード読み込み時と最後の解析結果書き出し時に
IO が走る以外は、オンメモリで計算のみを実行しています。
データ構造は木構造が多く、再帰処理を多用し、小さな一時オブジェクトを多く new し
ています。



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

In This Thread