From: sam.saffron@... Date: 2020-01-10T07:36:44+00:00 Subject: [ruby-core:96756] [Ruby master Misc#16487] Potential for SIMD usage in ruby-core Issue #16487 has been updated by sam.saffron (Sam Saffron). Could we do something that allows us to install a gem that gives us the speedup by rerouting stuff in MRI? Then you could install a pre-compiled binary of ruby if you wish and do `gem install ruby-simd` to get the optimised code paths? There is a concern around "docker" style distributions, cause generally people package ruby+pre-compiled gems in a single image. I guess a `ruby-simd` type gem could do a quick runtime check at boot to see if it needs to re-compile stuff if the "compiled" version does not match the current architecture and just pass a bunch of code to gcc/clang? ---------------------------------------- Misc #16487: Potential for SIMD usage in ruby-core https://bugs.ruby-lang.org/issues/16487#change-83747 * 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/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 -- https://bugs.ruby-lang.org/ Unsubscribe: