From: rogerdpack Date: 2008-12-14T13:14:40+09:00 Subject: [ruby-core:20542] Re: New shootout > And if I remember correctly, tweaking 1.9's GC also benefits from > tweaking [2]. example of what tweaking the gc can do [Cangiano benchmark] Ruby 1.9 normal: real-world/bm_hilbert_matrix.rb, 4.0054624080658,4.09904861450195,4.052255511283875,0.046793103218079,50 real-world/bm_hilbert_matrix.rb, 8.86907505989075,12.8570592403412,10.863067150115967,1.993992090225220,60 ruby 1.9 trunk with GC patch [1] real-world/bm_hilbert_matrix.rb, 2.87246918678284,2.8920271396637,2.882248163223267,0.009778976440430,50 real-world/bm_hilbert_matrix.rb, 6.63441443443298,6.49161219596863,6.563013315200806,0.071401119232178,60 With GC.disable real-world/bm_hilbert_matrix.rb, 2.61896514892578,2.60238766670227,2.610676407814026,0.008288741111755,50 real-world/bm_hilbert_matrix.rb, 5.82226586341858,5.81672692298889,5.819496393203735,0.002769470214844,60 So there is still room for improvement [i.e. with something like [0]], but some benefit is gained with tuning. Thanks! -=R [0] http://www.nabble.com/GC-patch-for-1.9-to-run-in-a-separate-thread-td20082948.html [1] Index: gc.c =================================================================== --- gc.c (revision 20731) +++ gc.c (working copy) @@ -75,7 +75,7 @@ #endif /* __GNUC__ */ #ifndef GC_MALLOC_LIMIT -#define GC_MALLOC_LIMIT 8000000 +#define GC_MALLOC_LIMIT 80000000 #endif #define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] @@ -281,7 +281,7 @@ int limit; }; -#define HEAP_MIN_SLOTS 10000 +#define HEAP_MIN_SLOTS 100000 #define FREE_MIN 4096 struct gc_list {