Issue #11559 has been updated by Motohiro KOSAKI. Status changed from Closed to Open ---------------------------------------- Bug #11559: ビジーループの thread と YAML.parse を組み合わせたときの実行時間が 2.2.3 で遅くなっている https://bugs.ruby-lang.org/issues/11559#change-54400 * Author: 三村 益隆 * Status: Open * Priority: Normal * Assignee: Nobuyoshi Nakada * ruby -v: 2.2.3 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- ビジーループするスレッドと YAML.parse を並行して実行するような以下のようなコードが 2.2.2 と 2.2.3 で、 数倍遅くなっているようです。trunk でも遅いことを確認してます。 ~~~ require 'thread' require 'yaml' puts RUBY_VERSION y = (1..1000).to_a.to_yaml t = Thread.new do while true; 1;end end 10.times do YAML.load(y) end t.kill ~~~ 実行結果 ~~~ $ time ruby thread_loop_with_while.rb 2.2.2 ruby thread_loop_with_while.rb 0.30s user 0.06s system 94% cpu 0.375 total $ time ruby thread_loop_with_loop.rb 2.2.3 ruby thread_loop_with_loop.rb 1.80s user 0.05s system 99% cpu 1.864 total ~~~ -- https://bugs.ruby-lang.org/