Issue #16487 has been updated by byroot (Jean Boussier).


SIMD Everywhere seem very interesting, but from a quick check it seems that=
 all the fallbacks are applied during compilation, which means you'd have t=
o compile ruby yourself to get the benefits.

If we want most users to benefits from the speedups, we need to a test at r=
untime like PHP does:

  - https://github.com/php/php-src/blob/e73cc44021a6549b0382bda90a0f4274c17=
22b24/Zend/zend_cpuinfo.h#L27
  - https://github.com/php/php-src/blob/aadd3aaed902a8f21c11984687a4e3d414a=
2caed/ext/standard/string.c#L3672-L3677

----------------------------------------
Misc #16487: Potential for SIMD usage in ruby-core
https://bugs.ruby-lang.org/issues/16487#change-83700

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Assignee: =

----------------------------------------
### Context

There are several ruby core methods that could be optimized with the use of=
 SIMD instructions.

I experimented a bit on `coderange_scan` https://github.com/Shopify/ruby/pu=
ll/2, and Pavel Rosick=FD experimented on `String#strip` https://github.com=
/ruby/ruby/pull/2815.

### Problem

The downside of SIMD instructions is that they are not universally availabl=
e.
So it means maintaining several versions of the same code, and switching th=
em either statically or dynamically.

And since most Ruby users use precompiled binaries from repositories and su=
ch, it would need to be dynamic if we want most users to benefit from it.

So it's not exactly "free speed", as it means a complexified codebase.

### Question

So the question is to know wether ruby-core is open to patches using SIMD i=
nstructions ? And if so under which conditions.

cc @shyouhei





-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>