Project

General

Profile

Misc #16487

Potential for SIMD usage in ruby-core

Added by byroot (Jean Boussier) 3 months ago. Updated 2 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
[ruby-core:96708]

Description

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/pull/2, and Pavel Rosický experimented on String#strip https://github.com/ruby/ruby/pull/2815.

Problem

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

And since most Ruby users use precompiled binaries from repositories and such, 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 instructions ? And if so under which conditions.

cc shyouhei (Shyouhei Urabe)


Related issues

Related to Ruby master - Feature #14328: SIMD vectorizationOpenActions

Also available in: Atom PDF