From: Roger Pack Date: 2010-03-20T01:45:59+09:00 Subject: [ruby-core:28796] [Feature #1047](Assigned) request: getters, setters for the GC Issue #1047 has been updated by Roger Pack. File bm_hilbert_matrix.rb added Status changed from Feedback to Assigned Attaching demo file. A little contrived still, but on my box, the things that help it improve are (believe it or not) -#define HEAP_MIN_SLOTS 10000 +#define HEAP_MIN_SLOTS 100000 12.3s normal gc.c to 10.4s Perhaps defining more space up front makes it not use N^2 garbage traversals as it grows? It appears that's useful when you know you're going to be needing the space eventually anyway...in reality you could also put it as the default and it wouldn't hurt "small scripts" too much either, I'd imagine. changing MALLOC_LIMIT has been shown effective in rails apps though I don't have any immediate numbers handy [1] As a side note, with 1.9.1 (default) it takes 14.8s, so some improvement already--thanks guys! If we do eventually go to a --server --client model, --server could include some other optimizations, too, like lookup cacheing http://redmine.ruby-lang.org/issues/show/641 While we're on the subject of GC optimization, you might be some speedup by making gc_stress settings only available if GC_DEBUG is defined--I highly doubt gc_stress is used much in the wild, though I could be proven wrong. Cheers! -rp [1] http://blog.evanweaver.com/articles/2009/04/09/ruby-gc-tuning/ "speedup of 34% " for 1.8 with similar settings. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1047 ---------------------------------------- http://redmine.ruby-lang.org