[#61424] [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals — Eric Wong <normalperson@...>

I'm unsure about this. I _hate_ the extra branches this adds;

13 messages 2014/03/12

[ruby-core:61426] Re: [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals

From: Eric Wong <normalperson@...>
Date: 2014-03-12 01:07:32 UTC
List: ruby-core #61426
Eric Wong <normalperson@yhbt.net> wrote:
> I'm unsure about this.  I _hate_ the extra branches this adds;
> and most of our benchmarks don't show an improvement.  But this
> seems like an obvious experiment, so maybe somebody else would've
> tried it if I didn't at least publish it here.

The extra branching hurt bm_so_count_words performance on my older AMD
Phenom II.  Not much difference either way on a more recent AMD FX-8320.

> http://bogomips.org/ruby.git/patch?id=8271ec7b977
	git://80x24.org/ruby.git gc-lessatomic

Updated with:
 http://bogomips.org/ruby.git/patch?id=d959cb6201

    gc.c (objspace_malloc_increase): annotate likely/unlikely branches
    
    This is necessary for an older AMD Phenom II X4 945 CPU
    to even match performance before the thread-local counters on
    bm_so_count_words.
    
    Original benchmarks were done on a Xeon E3-1230 v3 with Turbo Boost
    disabled.

In This Thread