From: "funny_falcon (Yura Sokolov)" Date: 2012-11-10T16:52:13+09:00 Subject: [ruby-core:49189] [ruby-trunk - Feature #6199] Organize gc.c a bit Issue #6199 has been updated by funny_falcon (Yura Sokolov). > I'm not sure that 3. improves a performance, because it's using binary search each one slot. Well, `free_unused_heaps` runs on each GC and does linear scan, and `free_unused_heap` runs only on heap's freeing. Heap freeing occurs rare in typical long running application, so that it is possibly that linear scan for each GC is overkill. But I could not prove it :) ---------------------------------------- Feature #6199: Organize gc.c a bit https://bugs.ruby-lang.org/issues/6199#change-32736 Author: funny_falcon (Yura Sokolov) Status: Assigned Priority: Normal Assignee: authorNari (Narihiro Nakamura) Category: core Target version: 2.0.0 1. Move immutable fields from struct heaps_slot and struct sorted_heaps_slot into struct heaps_header. One exception is limit field, but it starts to be mutable just before freeing a heaps_header, so that it is not big issue. 2. Embed bitmap into struct heaps_slot 3. Change `free_unused_heaps` to `free_unused_heap`, so that it will not be called on every GC round, but only when page should be freed. While `free_unused_heaps` does not consume much time (it is invisible in profiler), but regular application has no need in calling this function every time. https://github.com/ruby/ruby/pull/108 https://github.com/ruby/ruby/pull/108.patch -- http://bugs.ruby-lang.org/