[ruby-cvs:70554] normal:r63463 (trunk): gc.c: use monotonic counters for objspace_malloc_increase

normal at ruby-lang.org normal at ruby-lang.org
Fri May 18 17:29:28 JST 2018


normal	2018-05-18 17:29:28 +0900 (Fri, 18 May 2018)

  New Revision: 63463

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63463

  Log:
    gc.c: use monotonic counters for objspace_malloc_increase
    
    atomic_sub_nounderflow is expensive and objspace_malloc_increase
    was showing up near the top of some `perf` profiles.  The new
    implementation allows the compiler to inline and eliminate
    some branches from objspace_malloc_increase.
    
    Furthermore, we do not need atomics for oldmalloc_increase
    
    This consistently improves bm_so_count_words benchmark by
    around 10% on my hardware.
    
    name	built
    so_count_words	1.107
    
    [ruby-core:87096] [Feature #14767]

  Modified files:
    trunk/gc.c


More information about the ruby-cvs mailing list