Improving TruffleRuby Performance
nirvdrum.com
nirvdrum.com
Whats the easiest way to install it these days ?
Last time I thought of installing it, it required signing up for an account on the Oracle website simply to be allowed to download it, at which point I abandoned my attempt.
http://www.oracle.com/technetwork/oracle-labs/program-langua...
It has release 0.23 from a few days ago.
I think the home-brew recipe is not so recent (but may be wrong here).
It is also possible to build TruffleRuby and Graal entirely from open-source and no sign-up components, but currently this is not so easy as it needs building your own JVM with JVMCI (due to lack of recent OpenJDK releases on linux & macOS).
Aaaaalso, how does this compare to Eclipse Ruby+OMR?
Both JRuby & TruffleRuby are written in Java and target the JVM. JRuby now has its own IR for performing Ruby-level optimizations and it targets the JVM's invokedynamic system. TruffleRuby uses the Truffle self-optimizing AST framework [1] to implement its runtime and relies on integration with the Graal compiler to produce fast code via partial evaluation. Graal is a new compiler for the JVM written in Java. However, you need a JVMCI-enabled JVM to activate Graal. JVMCI is a new feature in Java 9, but we have a backport package available for Java 8 on the Oracle Technology Network (OTN) [3].
In addition, we ship a package with multiple Truffle languages and a Graal-enabled JVM in a package we call GraalVM. You can download that from OTN as well. That package also ships with a builder for the Substrate VM, which allows you to build an ahead-of-time compiled static binary of the various Truffle languages [4].
So, both JRuby and TruffleRuby target the JVM but they currently use different JITs. There's nothing stopping JRuby from using Graal, and indeed they've been looking at it, but they likely will continue using invokedynamic rather than Truffle.
Eclipse Ruby+OMR is a completely different project looking to take some VM components IBM has developed and integrate them with MRI. Since they're actually running MRI rather than a completely new project, they have 100% compatibility with Ruby, but they also have to operate within the confines of MRI's internal design.
[1] -- https://github.com/graalvm/graal/tree/master/truffle
[2] -- https://github.com/graalvm/graal/tree/master/compiler
[3] -- http://www.oracle.com/technetwork/oracle-labs/program-langua...
[4] -- http://nirvdrum.com/2017/02/15/truffleruby-on-the-substrate-...
Also wondering, for Truffle / GraalVM / SubstrateVM, how far are we from testing in production? I keep thinking TruffleRuby is Nightly / Beta and if i remember correctly, does not run Rails ( yet ) ?
I don't know if there's a more official channel, but I follow Matthew Gaudet's tweets (@MattStudies). He provides periodic updates and provides links to talks and such.
> Also wondering, for Truffle / GraalVM / SubstrateVM, how far are we from testing in production? I keep thinking TruffleRuby is Nightly / Beta and if i remember correctly, does not run Rails ( yet ) ?
We're not at the point where we recommend anyone run it in production. We do actually run a sizable portion of Rails, but since the DB adapters are all C extensions we can't really run those yet, which practically means we can't run Rails. The distinction is we're able to run with things like the pure Ruby PostgreSQL gem (postgres-pr) and the pure Redis gem (redis).
We're making some very good progress on our C extension support. We've just recently made a successful HTTPS request running MRI's OpenSSL extension by way of Sulong [1], which is an LLVM bitcode interpreter for Graal.
If you're interested in casually following what we're up to, we now have a Twitter handle (@TruffleRuby). Or, you could always watch the GitHub project [2], since it is open source.