From: ko1@... Date: 2014-11-27T01:56:53+00:00 Subject: [ruby-core:66504] [ruby-trunk - Bug #10511] [Closed] fix for #9940 causes dramatic performance regression Issue #10511 has been updated by Koichi Sasada. Status changed from Open to Closed % Done changed from 0 to 100 Applied in changeset r48596. ---------- * vm_core.h: add rb_thread_t::local_storage_recursive_hash to speed up Thread#[:__recursive_key__] access. [Bug #10511] * thread.c (threadptr_local_aref): add fast path for :__recursive_data__. * thread.c (threadptr_recursive_hash, threadptr_recursive_hash_set): add special accessor for recursive hash. * cont.c: store/restore local_storage_recursive_hash. * vm.c: init and mark local_storage_recursive_hash. * vm_trace.c (rb_threadptr_exec_event_hooks_orig): clear and restore local_storage_recursive_hash directly. ---------------------------------------- Bug #10511: fix for #9940 causes dramatic performance regression https://bugs.ruby-lang.org/issues/10511#change-50117 * Author: Oleg Sukhodolsky * Status: Closed * Priority: Normal * Assignee: Koichi Sasada * Category: core * Target version: current: 2.2.0 * ruby -v: ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- Originally reported against debase gem (https://github.com/denofevil/debase/issues/16) After fix for #9940 running anything under debugger became about 4 times slower. I've verified that we I revert the fix performance is restored. To reproduce you could get https://github.com/railstutorial/sample_app_rails_4 and run rspec rake task under debugger (I've used RubyMine for this because debase is used as debugger's backend there) Performance with 2.1.2 it takes about 20 seconds on my laptop, with 2.1.3 - almost 80 seconds :( The same problem is observable with 2.1.4 and 2.1.5 too. -- https://bugs.ruby-lang.org/