Since 2015 developers have been waiting for the release of Ruby v3.0.0 and it finally happened on the 25th of December. This major release aims to improve performance, concurrency and typing.
We are pleased to announce that support for Ruby 3.0 is now available to Cloud 66 customers. To run a new application with Ruby 3.0, you should set your Ruby version using your manifest file and then deploy your application. To do this with an existing app, you will need to update the version in your manifest and then roll out the upgrade using one of our recommended deployment strategies.
What's new at Ruby v3.0.0?
Ruby 3.0 promises improved performance, concurrency, and static analysis. This should make Ruby even more scalable, faster, and easier to use. There are, as always, some transition issues to consider.
Performance:
- Ruby 3.0 will be three times faster than the current Ruby version thanks to Ruby’s performance optimization. It's worth noting that, although Ruby will run faster, other components of your application will stay the same e.g. databases.
- Memory performance is improved via garbage compactor, which includes object separation and auto-compaction.
- Ruby CPU performance is updated with a new Ruby JIT. However, the new compiler is not yet ready for the Rails applications.
Concurrency:
- Falcon Rack and Async features do not block I/O (input and output data). This will save a lot of time.
- Ruby now is a single-flow language and it allows for parallel task execution.
- Actor-like Ractors have been (experimentally) introduced as a new concurrency abstraction.
Static Analysis:
- The RBS language is a new, official way to describe types used in Ruby programs and TypeProf can infer types from existing Ruby code.
- Steep uses parallel annotation files. This allows you to keep type annotations in a separate file.
- Sorbet uses inline type annotations. It's fast, but it is still relatively new.
Transition issues:
- You need to upgrade to Ruby 3.0 manually. It is possible that code in the current Ruby version may be deprecated after the update.
- Ruby 3.0 will show you warnings before the update. This will allow you to see in advance what needs to be fixed after the upgrade in the logs.
- The Ruby team made sure that the Ruby 3.0 changes are backward compatible for all the previous versions. It will be easy to switch from one version to another.
We hope you enjoy using Ruby 3 for your own applications.