From: Kurt Stephens Date: 2011-07-20T15:21:51+09:00 Subject: [ruby-core:38245] [Ruby 1.9 - Feature #5033] PATCH: 1.9: gc_mark_children: Avoid gc_mark() tail recursion, use goto again. Issue #5033 has been updated by Kurt Stephens. There is a time improvement for Arrays deeply nested at their tails: Stock: + ./miniruby -e ' x = [ nil ] 10000000.times do | i | x[0] = [ i ] x = x[0] end puts :OK system "ps -l -p #{$$}" ' OK UID PID PPID F CPU PRI NI SZ RSS WCHAN S ADDR TTY TIME CMD 501 96240 84698 4006 0 31 0 2447588 3096 - S+ fda67e0 ttys009 0:02.28 ./miniruby -e ^Jx = [ real 0m2.293s user 0m2.275s sys 0m0.013s + git checkout trunk-gc-mark-optimization Switched to branch 'trunk-gc-mark-optimization' + ./miniruby -e ' x = [ nil ] 10000000.times do | i | x[0] = [ i ] x = x[0] end puts :OK system "ps -l -p #{$$}" ' OK UID PID PPID F CPU PRI NI SZ RSS WCHAN S ADDR TTY TIME CMD 501 20407 84698 4006 0 31 0 2456804 3096 - S+ fda67e0 ttys009 0:02.08 ./miniruby -e ^Jx = [ real 0m2.096s user 0m2.074s sys 0m0.014s ---------------------------------------- Feature #5033: PATCH: 1.9: gc_mark_children: Avoid gc_mark() tail recursion, use goto again. http://redmine.ruby-lang.org/issues/5033 Author: Kurt Stephens Status: Assigned Priority: Normal Assignee: Narihiro Nakamura Category: core Target version: 1.9.x Minor GC improvement. Avoid recurring into gc_mark() when "goto again;" is sufficient. -- KAS -- http://redmine.ruby-lang.org