Project

General

Profile

Actions

Feature #14767

closed

[PATCH] gc.c: use monotonic counters for objspace_malloc_increase

Added by normalperson (Eric Wong) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Target version:
-
[ruby-core:87091]

Description

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.

This consistently improves bm_so_count_words benchmark by
around 10% on my hardware.

name built
so_count_words 1.107

We started this discussion back in [ruby-core:61508]
https://public-inbox.org/ruby-core/5323FE11.3000908@atdot.net/
I may revisit non-atomic counters another day, but I think
this patch is good for now since I haven't found a downside
(running full benchmarks, will take a while)


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0