New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A first naïve look at TruffleRuby #1054
Comments
Thanks this is really helpful. It's great that you managed to install a gem, all its specs passed first time, and the application actually ran (did you check the output is correct?) The speed isn't terrible for a first look. We can start to run it with some tooling enabled and we'll see where things are. It's possible that:
|
@chrisseaton glad you find this useful! I believe the output is correct but I will double check though. I'm generating a CSV file then running Thanks for the hints! I'll definitely dig deeper. |
This is wonderful to document your effort here @thbar. As a "user" and just an excited person I thank you! And thank you also for beating the drum on
I'm sure that a lot of additional benefits could be enumerated, but yeah... bang, bang, bang... 😸 |
re: RVM, I use chruby, so I think whatever it takes to make TruffleRuby easy to install should be able to work for both. :-) |
While I agree that it should be agnostic, I also believe in going after the lowest hanging fruit that has the highest return on investment. If we have to choose, then choose the one that will yield initial highest return and them move on. Personally I don't like I also much prefer |
|
@thbar theoretically that would be nice. Maybe it's possible - I hope so. Realistically I think they'll have to focus on one first and then move to the others and if that proves to be true I think they'll choose the largest user bases first and then move on ( |
Let's not start discussing which Ruby manager is the best in this thread :) TruffleRuby has a clear philosophy of not debating how people want to code or what tools they want to use, and we'll aim to support any Ruby manager we can https://github.com/oracle/truffleruby/blob/a72380e7d6743304909abd4f9e85919a4126dde0/doc/user/compatibility.md#compatibility. I think the main blocker for this is not having an easily download-able tarball. I will check our support for managers and make sure tests and documentation is in place, and open issues for any problems. |
@chrisseaton if you discuss this, I think ultimately it would be great to have a much smaller download (maybe a sub-build or something) including only the parts relevant to TruffleRuby. Well - I hope you'll be heard, thanks for tackling this! |
I will need to look into the performance later, but here are some answers.
No the SVM is faster for start-up time, but slower for peak-performance in most cases.
Ok we'll add more documentation on this.
We'll renew our documentation and tests for the Ruby version managers.
That's normal isn't it? Use the included
Yes I'll renew looking into this.
This isn't likely to change soon. It's a few hundred MB yes. I don't think that's totally unreasonable compared to a normal JVM.
Did you open an issue for this?
Each language provides its own directory of binaries, and then there are links to them from the main binary directory.
Yes this has some internal technical problems behind it. We'll fix it. |
A couple more answers:
The warnings are gone on
I think it's best to split that in another issue, specifically about performance of your workload. |
General documentation improvements in #1060. |
Apart from the macOS patch for RVM, which we need to upstream and will, all three major Ruby version managers work fine and are tested. They just can't download TruffleRuby for you - that's a missing bit. |
Actually the macOS patch for RVM isn't needed any more, so they all work out-of-the-box now. |
I think I've opened new issues for all the specific remaining problems identified here. |
Will it be possible in the future to just download TruffleRuby without needing a one-time registration (and yet another one-time-use account)? If the setup would be fully automatic, you would probably get loads of more people testing with it. |
We hope soon to make it possible to just download TruffleRuby without any registration at all. |
what's the difference between Truffle ruby and Crystal lang? btw, thx for your huge report, it seems promising e: thx for the responses btw.. very nice and good info :D |
@girng I am no Crystal expert but here is my view of it, which might be slightly wrong. |
@girng glad you found the report useful! I believe TruffleRuby aims at being a drop-in replacement which you can use on regular ruby programs, while Crystal (which I used on occasions) is a ruby-spirited language (but you won't be able to run regular ruby programs unmodified, you will have to adapt, sometimes lightly, sometimes quite deeply, as I've experienced). |
I wanted to try out TruffleRuby, so I took raw notes as I went, and thought it would be maybe useful to report them (like a kind of onboarding experience).
Please feel free to close the issue or explode it into multiple parts, but at least this can be linked if other outsiders are willing to try it out.
My interest for TruffleRuby comes from the fact I'm doing data processing with Ruby (using Kiba ETL), so if ultimately I can get a much better throughput, that will be of high interest.
I managed to get the Kiba ETL test suite to pass (it's a small gem), and also to get some little benchmarks to run.
So far my test with TruffleRuby are much slower than MRI 2.5.0, but I think this is still interesting to report. I think I'm probably using the slower TruffleRuby without SVM (if I understand https://github.com/oracle/truffleruby/blob/master/doc/user/svm.md).
Please consider this as constructive feedback even if it's in raw form, I know raw input can be helpful to have an outsider look on things!
"Hot" points
gem
to installbundler
etc. Worked great after downgradingbundler
to a compatible version.require_relative
seems to work differently compared to MRI (viainstance_eval
at least).Raw notes
First I wondered what is the fastest TruffleRuby available today? I'm not sure to understand what exactly is SubstrateVM, how do you install it, how it is related to GraalVM etc or not.
Ultimately I just picked the first installable version I could find.
Then I can unpack:
This way I have:
and I can run Ruby with:
Why is there a
ruby
in two places of the tgz, I don't know.To go further, I wanted to run the Kiba test suite, here is what I had to do:
gem
command is located (I thought it wouldn't exist initially, but usedfind
to see that it was available)rvm
not to try to do anything (or I'd get warnings)bundler
is supported (I didn't see a bundle command in the tgz)gem install minitest-focus
worksThen I realized that maybe installing
bundler
as a gem would work:It worked fast enough, but then it started installing the documentation, which took almost 2 minutes & made my CPU go to 400%:
(Yup, 115 seconds).
I added a
~/.gemrc
file with this:in order to try to avoid that.
Then I tried to install the Kiba development dependencies, but got this error:
I checked the rubygems page to verify what's the latest 1.14.x here https://rubygems.org/gems/bundler/versions then ran:
I finally ran:
which took my CPU back to 360%, and showed a few warnings, but ultimately succeeded:
At this point I was able to run Kiba's test suite:
YAY! Success!
Since Kiba's tests were passing, I went further to the benchmarks:
Then I wanted to run the benchmark, but got:
I believe there is a subtle difference in the way require paths are handled, at least when using
instance_eval
like Kiba does.I replaced this:
by:
Then I was able to start and get a time:
The output seems correct (the checksum for
data/output.csv
) but this is massively slower than Ruby 2.5.0:The text was updated successfully, but these errors were encountered: