Sunday, June 26, 2011

欠席裁判

Bug 3924 Performance bug (in require?)


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/37303

Ticket in redmine http://redmine.ruby-lang.org/issues/3924

nahi (Hiroshi Nakamura) measured loading times of 2 rails 3.0.7 apps on 1.9.2p274, 1.9.3dev r32204, 1.9.3dev r32204 with Shyouhei's expand_path cache patch.

He asked a downside of this patch.

Then, mame3 (Yusuke ENDOH) said that paths stored in cache won't never be collected by GC.

--

中村さん (nahi)が2つのrails 3.0.7アプリにおいて,1.9.2p274, 1.9.3dev r32204, 1.9.3dev r32204 に shyouheiさんのexpand_path cache patchを加えた物で起動時間を測定しました.

そして彼はこのパッチのデメリットを聞いたところ,遠藤さんがキャッシュされたpathはGCされず,メモリリークするのではないかとの懸念を示しました.

[ruby-dev:43898] Bug assigning party


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/43898

Sasada announced bug assigning party will be held tomorrow. (6/26 JST)

The party attendees assign not-assigned tickets to maintainers, etc.

Not-assigned tickets are over 100.

--

ささださんが1.9.3リリース前に,未アサインのチケットを
誰かに押し付け
適切な担当者にアサインする会を開くそうです.

欠席裁判怖い

kosaki0: こわい
kosaki0: いないと欠席裁判で無茶振りされる会ですか
ko1_ndk: そうです>無茶ぶり

(Logs from #ruby-ja, ircnet)

Feature 4921 Remove intern.h


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/43875

Ticket in redmine http://redmine.ruby-lang.org/issues/4921

Naruse proposed that remove intern.h.

First, what's intern.h?

I think intern means "internal", but if it is, it's not good that intern.h is in include/ruby.

Matz agreed at [ruby-dev:43876] if it won't raise compatibility problem.

This change will be included soon.
Contents in intern.h will be moved into ruby.h, and intern.h will only include ruby.h and nothing else.

[ruby-core:37336] I have imported Rake 0.9.2 to trunk


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/37336

Eric imported rake 0.9.2 to trunk.

Eric が rake 0.9.2 を trunk にマージした旨を伝えています.

Bug 4920 Process.daemon()呼び出しによりタイマースレッドが2つ出来てしまう


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/43873

Ticket in redmine http://redmine.ruby-lang.org/issues/4920

Kosaki reported a bug that another 2 timer threads are created when call Process.daemon.

Fixed at r32221.

[ruby-dev:43901] ThreadGroup#make_local_space! (Re: ThreadGroup の強化案)


From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/43901

Patch (from r32226) pasted on mail

Nagai proposed method ThreadGroup#make_local_space as a ThreadGroup improvement.

ThreadGroup#make_local_space creates independent space by a one ThreadGroup for methods.

Method that defined in ThreadGroup that has local space is available only in that ThreadGroup.

Other ThreadGroups can see original method, they don't get effect.

Wednesday, June 22, 2011

Bug 4909 Trap handlers should not be re-enterable?


From [ruby-dev:43852] trapハンドラは再入されてはいけないのではないか?

Ticket in redmine http://redmine.ruby-lang.org/issues/4909

Kosaki said, the following code shouldn't raise any Exception.

n = 0
intrap = 0

parent = $$

trap(:USR1) {
  if intrap == 1
    raise "trap nested"
  end
  intrap = 1
  10000.times {
    n += 1
  }
  intrap = 0
}

fork do
 Process.kill(:USR1, parent) while true
end

sleep 100

Problems are:

  • You can raise stack overflow by throwing signal continuous (like this program).
  • There is no signal blocking method; like sigprocmask() in ruby level, so we can't write good signal handlers in ruby.

He also said that C masks signal during running signal handler, so MRI should make same consideration as C.

Feature 4891 Vector#normalize


From [ruby-dev:43829] Vector#normalize

Ticket in redmine http://redmine.ruby-lang.org/issues/4891

Patch (by mrkn) https://gist.github.com/1029140

mrkn suggested new method Vector#normalize to normalize Vector.

Lafortune will be import this method.

Is there feature freeze to release 1.9.3? I think no announce exists about freezing.

[Bug 4444] Errors at test_parallel.rb on Windows platform


Ticket in redmine http://redmine.ruby-lang.org/issues/4444

Now windows can run make test-all parallel. thanks usa.

[ruby-list:48190] [ANN]RubyKaigi2011 1st day night "YamiRubyKaigi2011" information and call for proposals


From [ruby-list:48190] [ANN]日本Ruby会議2011 1日目夜「闇RubyKaigi2011」開催情報とスピーカー募集のお知らせ

Related link (Japanese) http://yamirubykaigi.wordpress.com/

"YamiRubyKaigi2011" will hold at RubyKaigi2011 1st day night.

RubyKaigi2011 attendees can attend this event too.
And YamiRubyKaigi2011 has limited special attending campaign. RubyKaigi2011 executive committee will announce that.

Information page (Japanese): http://yamirubykaigi.wordpress.com/2011/06/21/yamirubykaigi2011info/

RubyKaigi 1st day night; 7/16(Sat) 20:00-21:30 (JST)

http://rubykaigi.org/2011/en/schedule/details/16MDN

YamiRubyKaigi2011 also wants speakers.

CFP description is here: http://yamirubykaigi.wordpress.com/2011/06/21/yamirubykaigi2011cfp/ (Japanese)

Theme: Anything about Ruby

Time: 3min-5min

This is last chance to talk in RubyKaigi2011.

You can apply to this event as speaker before RubyKaigi2011 or at RubyKaigi2011 first day (detail will be announced at place!)

Tip: Yami (闇) means darkness in Japanese.

Note: This page is not official announce.



闇RubyKaigiとやらがRubyKaigi2011の1日目の夜にあるそうですよ.

Feature 4907 enumerable#permutation and combination


From [ruby-core:37231] enumerable#permutation and combination

Ticket in Redmine http://redmine.ruby-lang.org/issues/4907

既にArrayにはpermutationcombinationで組み合わせ,順列を生成できるが,Enumerableなオブジェクトでもできるべきだという提案.

今のところ進展は見られない.

Saturday, June 18, 2011

Write a patch!

This is my first report; 最初のレポートをお届けします.

[ruby-dev:43834] new deadlock detection


ko1 proposed a new deadlock detection method with patch.

How it works


  • "Thread waker" changes sleeper
  • Only compareing living thread num and sleeper is needed for detection

Asset


  • Deadlock detection code is more beautiful than currents.

Patch


patch is in mail (base64 encoded)

[ruby-core:37164] Enumerable#lazy


(1..100).map{|x| 長い文字列等を生成する作業 }.select{|x| それを選択する作業 } 等だと,まず Enumerable#map を実行して
中間配列を生成,そしてその配列を Enumerable#select に渡すのですが,長い文字列等を作り配列にするとかなりのメモリを消費するため,
生成した物を中間配列を生成せずにそのまま次の Enumerable#select に渡したいよね,という話は前から上がっていた. (後述の rude_map もそれ)

Enumerable#rude_map なども良いが,見た目カッコ悪い.どうせなら別のEnumeratorを生成して,綺麗にどんなメソッドでも遅延評価できると良いのでは? という案もあった.

このチケットはその案,Enumerable#lazy を実装し, (1..100).lazy.map{|x| 長い文字列等を生成する作業 }.select{|x| それを選択する作業 } などで好きなEnumerableメソッドを遅延評価できる.

Enumerable#lazyEnumerable::Lazy クラスのオブジェクトを返します.

Enumerable::LazyEnumerable のサブクラスで,Enumerableをインクルードしています.そのためあなたはLazyでもEnumerableと同じメソッドを利用することができるそうです. (ただし一部のメソッドはLazyで再実装されている物もあります)

Ruby での実装 (動作を確認するための仮の実装) lazy.rb

あわせて読みたい #4653 Enumerable#rude_map

[ruby-core:37170] Literal Instantiation breaks Object Model


例えば String.new ではinitialize呼ばれるのに,リテラルから生成した場合呼ばれないじゃねーか.と

リテラル化するときもRubyレベルで定義されたinitialize呼ぶべきじゃないでしょうかー.というバグ(提案?)

バグには見えないし,対応する理由も特に見当たらないのでReject.奥義「パッチを書いてこい」