Issue #9225 has been reported by tmm1 (Aman Gupta).

----------------------------------------
Bug #9225: [patch] add WB to NODE_CREF
https://bugs.ruby-lang.org/issues/9225

Author: tmm1 (Aman Gupta)
Status: Open
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: 
Target version: current: 2.1.0
ruby -v: trunk
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


In our rails app, there are a lot of long-lived NODE_CREF:

>> p ObjectSpace.count_nodes
=> {:NODE_IF=>3, :NODE_CREF=>45810, :NODE_IFUNC=>11}

These are static objects, but are considered SHADY and contribute to the size of the remembered set:

>> GC.stat[:remembered_shady_object]
=> 49667

With the following patch, NODE_CREF are no longer shady and can be promoted: https://github.com/tmm1/ruby/commit/c5e8341

This reduces the size of the remembered set in our app, and speeds up minor GC from 22ms to 18ms per run.
After the patch:

>> GC.stat[:remembered_shady_object]
=> 10506

The patch is passing make test-all with RGENGC_CHECK=2


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