Project

General

Profile

Actions

Feature #14328

open

SIMD vectorization

Added by ahorek (Pavel Rosický) about 6 years ago. Updated over 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:84688]

Description

Hello,
in order to make ruby faster, I'd like to propose an optional SIMD optimization for some cases. I want to target SSE2 which is available in all modern x86 processors. (Pentium 4, Athlon 64 and newer).

this is usually automatically handled by GCC during compilation time, but because of dynamic nature of ruby, redefinitions etc. It's very hard to preoptimize it before the actual execution.

use auto-vectorization provided by JIT ( https://bugs.ruby-lang.org/issues/12589 )

GCC can do that, but I'm not sure how reliable and effective it is today

Pros:
we don't have to do anything, let GCC do the job
bigger scope for optimizations

Cons:
slower compilation

specialize known bottlenecks by hand

Pros:
predictable performace
without increased compilation time

Cons:
code complexity

unfortunatelly using SIMD isn't for free, there's an overhead, it needs a large data set to be effective. It's useful mainly for math operations, sum, min, max, arrays, matrixes, string manipulations etc. There probably won't be any significant benefit for appliactions like Rails.

what do you think about it?


Related issues 1 (1 open0 closed)

Related to Ruby master - Misc #16487: Potential for SIMD usage in ruby-coreOpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0