[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Ruby 2.5.0 Overview

Ruby 2.5.0 Overview

Leia em PortuguÃas

This item in japanese

Jan 25, 2018 1 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

Following the Christmas tradition for a sixth year in a row, a new major release of Ruby was released on December 25th. Ruby 2.5.0 features performance enhancements, improvements to Struct initialisation, the ability to print stacktraces in reverse order and more, and several common libraries have been promoted to default gems.

Ruby 2.5.0 features several performance related improvements with the most notable being removing all trace instructions from bytecode, thus improving performance by 5-10%. Trace instructions were added to support TracePoint, however in most cases TracePoint wasn’t used, adding pure overhead. Ruby now supports a dynamic instrumentation technique. Other performance related improvements include three times faster block passing as a block parameter and two times faster ERB code generation from templates. Performance has also been improved for built in functions like Array#concat, String#concat and Enumerable#sort_by and the Mutex class used in multithreading.

Aside from performance improvements, Struct.new can now create classes that accept keyword arguments and do/end blocks can work directly with ensure/rescue/else flows.

On library support, the following standard libraries cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib have been promoted to default gems, while the favorite pp command now comes built-in with ruby eliminating the need for "require ‘pp’ " -- which is one of the most commonly written lines of code in Ruby.

Ruby developers now have the option to print stacktrace in reverse order, the intent being to reveal the main error message on top instead of the bottom of the trace. This feature is experimental and may be removed at a later release. Branch and method coverage measurement is also supported, allowing for better performance testing around invocations of different methods and branches during code execution.

Top level constant lookup has now been completely deprecated, emitting an error instead of a warning. yield_self has been added to yield a given block in its context and unlike tap, also return the block result, which can be useful for object chaining.

Ruby 2.5.0 can be downloaded from the official site.

Rate this Article

Adoption
Style

This content is in the Ruby topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /