[#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:61579] Re: [ruby-trunk - Feature #9425] [PATCH] st: use power-of-two sizes to avoid slow modulo ops

From: Eric Wong <normalperson@...>
Date: 2014-03-18 19:42:38 UTC
List: ruby-core #61579
funny.falcon@gmail.com wrote:
>  Can you test this
>   + if (SYMBOL_P(a)) a = (a >> RUBY_SPECIAL_SHIFT) ^ (a >>
>  (RUBY_SPECIAL_SHIFT + 3)); /* 3=ID_SCOPE_SHIFT */

Seems to hurt performance on x86 compared to my original.  I don't think
ID scope bits are useful for this case.  From what I've seen, Ruby users
tend to limit symbol names to \w when using the Hash class and keywords.

In This Thread

Prev Next