r/ruby • u/ioquatix async/falcon • Dec 25 '18
Ruby 2.6.0 Released - thank you everyone who worked hard for this release!
https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/5
u/remember_this_shit Dec 25 '18
Did a search for this, but what is good about the JIT compiler? I’m not exactly sure what makes it useful or unique, but it’s at the top of the page and seems important.
12
u/ioquatix async/falcon Dec 25 '18 edited Dec 25 '18
That's a good question.
The JIT compiler has required quite a bit of internal restructuring to improve both non-JIT and JIT code paths. Ruby is highly dynamic, so it's hard to get the compiler to inline operations. I think this refactoring has been a useful exercise in order to appreciate what is required to get really good performance from a dynamic language like Ruby.
I'm honestly not sure if the direction of the JIT compiler is going to yield good performance. When you look at how advanced some JIT compilers are (e.g. Node), you realise it's a lot of effort to get to native performance in general code. The approach used by Ruby is quite basic, but it also minimises the changes required within Ruby, which isn't a bad trade-off.
JIT compilers balance the time required to compile the code vs the performance improvement of the compiled code. Based on what I can see happening, I think the assumption is that we can spend a long time to compile much more efficient code, with a minimal impact to the running system. The majority of Ruby code that would benefit from JIT compilation are things like long running web applications, so the potential pay off is quite big if it actually yields an improvement.
I think the biggest issue will actually relate to Ruby itself: we already have a lot of native extensions. Therefore, JIT compiling the glue code might not make a significant improvement in performance. Additionally, I think it's a reasonable assumption that IO is one of the dominating factors in performance of web applications (e.g. client, database and filesystem); even if the JIT compiler might make Ruby 10x faster, it can't change fundamental designs relating to IO or CPU contention, which require completely reimagining how those things should work in the language.
Hence my work on coroutines, Fibers and https://github.com/socketry - it's a paradigm shift which makes it easier to write highly concurrent and parallel code.
2
u/remember_this_shit Dec 25 '18
Thank you for your thoughtful response! Helps to put everything in context more.
0
Dec 26 '18
[deleted]
4
u/ioquatix async/falcon Dec 26 '18
In some cases it's an improvement, in other cases it's a disadvantage. Hopefully as the relevant developers gain more insight into the performance characteristics, more areas will be improved and less areas disadvantaged :)
0
Dec 26 '18
[deleted]
1
u/jamatthews Dec 28 '18
The JIT already improves tight loop performance. Whether or not it helps your application depends on the application.
31
u/jrochkind Dec 25 '18 edited Dec 26 '18
Not mentioned is a performance improvement to Dir.glob that will significantly speed up Rails template lookup, especially impactful with development settings and many partials. Contrary to some comments, my observations indicate this is not pertinent only on Windows, it also in my observations applies to MacOS, where many of us do development.
Thanks ruby committers!
2
14
10
u/schneems Puma maintainer Dec 25 '18
Try it on Heroku https://devcenter.heroku.com/changelog-items/1542
19
u/BluePizzaPill Dec 25 '18 edited Dec 25 '18
According to ruby-audit this version is vulnerable on arrival:
Name: ruby
Version: 2.6.0.0
Advisory: CVE-2018-16395
Criticality: Unknown
URL: https://www.ruby-lang.org/en/news/2018/10/17/openssl-x509-name-equality-check-does-not-work-correctly-cve-2018-16395/
Title: Incorrect equality check in OpenSSL::X509::Name
Solution: upgrade to ~> 2.3.8, ~> 2.4.5, ~> 2.5.2
Name: ruby
Version: 2.6.0.0
Advisory: CVE-2018-16396
Criticality: Unknown
URL: https://www.ruby-lang.org/en/news/2018/10/17/not-propagated-taint-flag-in-some-formats-of-pack-cve-2018-16396/
Title: Tainted flags not always propogated in Array#pack and String#unpack
Solution: upgrade to ~> 2.3.8, ~> 2.4.5, ~> 2.5.2
Vulnerabilities found!Altough the issues seem to have been fixed in ruby-2.6.0-preview3. So be wary if you have ruby-audit as part of your build/CI etc. either the advisory db needs a update or ruby needs fixes.
9
Dec 25 '18
Have you reported it on the mailinglist?
3
u/BluePizzaPill Dec 25 '18
No. Which mailinglist?
14
Dec 25 '18 edited Dec 25 '18
It seems like someone have already reported (and fixed!) your findings here: https://github.com/rubysec/ruby-advisory-db/pull/374
3
u/ViniStock Dec 26 '18 edited Dec 27 '18
Anyone having issues with controller specs for Rails 4.2.10 and Ruby 2.6.0?
I test one of my gems against multiple versions of Ruby and Rails and the combination of Rails 4.2.10 and Ruby 2.6.0 is giving me a "Thread error: Already initialized" when running controller specs (error can be seen here: https://travis-ci.org/vinistock/sail/jobs/472205140).
Edit: issue is being tracked in the Rails repo https://github.com/rails/rails/issues/34790
Edit2: Rails 4.2.x only receives security updates at this point, so this will not be fixed. Rails 4.2.x will not support Ruby 2.6.0.
0
u/TotesMessenger Dec 25 '18
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
[/r/rubylang] Ruby 2.6.0 Released - thank you everyone who worked hard for this release! (x-post /r/ruby)
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
0
Dec 26 '18
[deleted]
10
u/ioquatix async/falcon Dec 26 '18
I can certainly understand where you are coming from.
But remember, almost everyone who works on Ruby does it because they love it.
very small little random tweaks
Given how many hours I worked on improving coroutines for 2.6, this statement comes across as pretty harsh and uninformed.
It's true that as lower hanging fruit is picked, it gets harder and harder to improve performance. Honestly, the caliber of developers working on Ruby performance is really incredible. It's not easy to change the interpreter, and it's easy to break a lot of software if we are not careful.
a zero-day security flaw
My understanding is there was a bug in the software reporting the CVEs, there aren't actually any known CVEs in 2.6.0 - feel free to correct me if I'm wrong.
a JIT which hurts performance under Rails
The JIT isn't my area, but it's an experimental feature which we can now test. Unless we gather such information, we can't make forward progress. It's a particularly difficult area. I think everyone wish there was a simpler way to gain significant performance, but it's unfortunately not that easy.
My wish for Ruby that'll never happen: semantic versioning and honesty about whether it is or not.
Please feel free to get involved here https://bugs.ruby-lang.org/issues/15456
0
Dec 26 '18
[deleted]
2
u/ioquatix async/falcon Dec 26 '18
For me, the key parts of semantic versioning are:
Bump major version if breaking backwards compatibility.
Bump minor version if adding new features.
Bump patch version if releasing bug fix or performance improvements.
All the above are advisory to a certain extent. Because you need to define "breaking backwards compatibility". e.g. If you have a public method but no one uses it, is it okay to remove it? We should try to avoid bumping major version too often because practically speaking it's hard for users to keep up.
That doesn't mean you can't bump versions whenever you want. Of course, you can just arbitrarily bump version on Christmas. Sometimes it's good to have goals like that.
That being said, it's clear to me Ruby needs to have a consistent mechanism for versioning across the entire system. I think most gems use semantic versioning, but as you say, it's not clear how many of the core developers respect such an idea.
I think PEP is a good idea to a certain extent. The best we have right now is the Ruby bug tracker. It's the spiritual equivalent.
2
u/realntl Dec 26 '18
How much do you think strict semantic versioning will actually improve anything about day to day development with ruby? I can't figure out why that would matter.
1
u/ioquatix async/falcon Dec 26 '18
Because of stuff like this: https://github.com/ruby/bigdecimal/issues/114
1
u/realntl Dec 27 '18
Ruby is our core programming language. We tend to anticipate releases introducing incompatibilities and deal with it accordingly. In particular, we tend to expect breaking changes on "minor" updates (e.g. 2.5 to 2.6). Sure, it's a bit frustrating that ruby's versioning doesn't align with what has become a de facto standard, but I don't think it really impacts end users beyond that.
Bigdecimal is a library that comes bundled in with Ruby. If both ruby itself and bigdecimal followed semver, it wouldn't be enough to prevent the issue you referenced. The ruby team would also have to agree to hold off on major updates to stdlib components like bigdecimal. So, ultimately, I think the issue is less about whether the rules of semver are followed (or not) and more about whether ruby should be more conservative in it's approach to changes and backward compatibility.
2
u/ioquatix async/falcon Dec 27 '18
While I understand where you are coming from, the breaking change here, removing
BigDecimal.new, probably shouldn't be done until a major version bump. It's not holding anyone back. Adding a warning is appropriate ("This method is deprecated"). It's not about preventing the issue because of SerVer, it's that:
BigDecimal.newshouldn't have been removed so casually.There should be a way to signal breaking changes to users via versioning.
0
Dec 26 '18
[deleted]
-2
u/BooCMB Dec 26 '18
Hey CommonMisspellingBot, just a quick heads up:
Your spelling hints are really shitty because they're all essentially "remember the fucking spelling of the fucking word".You're useless.
Have a nice day!
-2
u/ComeOnMisspellingBot Dec 26 '18
hEy, TrAcYcHaVeZ, jUsT A QuIcK HeAdS-Up:
PuBlIcAlLy iS AcTuAlLy sPeLlEd pUbLiClY. yOu cAn rEmEmBeR It bY EnDs wItH –cLy.
HaVe a nIcE DaY!ThE PaReNt cOmMeNtEr cAn rEpLy wItH 'dElEtE' tO DeLeTe tHiS CoMmEnT.
2
u/Mike_Enders Dec 27 '18
I know you have been downvoted mercilessly by the fanboys but you are not alone. For the big christmas day release when you hopefully get a release that justifies you hanging with ruby, while the rest of the world marches on, this was underwhelming.
I'd rather they just drop the whole christmas day so we must release motivation and just wait and take their time to get out of experimental status.
0
Dec 28 '18
[deleted]
1
u/Mike_Enders Dec 28 '18
I wouldn't say deceptive myself . I think it just comes down to complacency. as ruby falls further and further behind the community has sold itself that progress and performance is over rated. Syntax is supposed to overcome all - but it doesn't. we went kicking and screaming to node because we needed performance on a couple projects . Hated it, hated it until I could live with it until I thought it was passable , until I thought it was okay until I was used to it enough to think in it until the syntax was second nature, until egads!!!! syntax didn't matter.
now that I can read Js almost as well as ruby I do the unthinkable. think of doing projects in node when I don't have to. when I see other language upgrades they give confidence the are blazing into the future opening new doors. When ruby updates its giving something (as experimental) that was available years ago in many other languages.
13
u/zitrusgrape Dec 25 '18
u/ioquatix what is the status with fibers improvments?