rubies100745788orig

What's new in Ruby 2.5

Ruby, one of the more venerable dynamic languages, has just gained in performance with the new 2.5 release.

Arriving on Christmas Day 2017, Ruby 2.5.0 is the first stable release in the 2.5 series.

New performance features in Ruby 2.5

It boosts performance by 5 to 10 percent by removing trace instructions from bytecode that has been found to be overhead. A dynamic instrumentation technique is used instead. Also, block passing by a block parameter has been made three times faster than it was in Ruby 2.4, through use of the Lazy Proc allocation technique.

Other features that improve performance include:

  • Document generation has been boosted by switching from the legacy lexical analyzer from IRB to Ripper.
  • The Mutex class has been rewritten to make it smaller and faster. Mutex can be used to manage access to shared data from concurrent threads.
  • ERB generates code from a template at twice the speed as version 2.4.
  • Performance has been improved in built-in methods including Array#concat, Enumerable#sort_by, and String#concat.

Other new Ruby 2.5 features

Other improvements in Ruby 2.5 include:

  • Struct/new can create classes that accept keyword arguments.
  • Do/end blocks will now work directly with ensure/rescue/else.
  • The pp.rb library loads automatically.
  • An option has been added to print backtrace in reverse order. The intent is to get the main error message without needing to scroll.
  • To improve testing, support is offered for branch and method coverage measurement. Branch coverage reveals which branches are executed, while method coverage indicates which methods are invoked.

Ruby 2.5 also features a bug fix in which the SecureRandom library, for generating random numbers, which now prefers OS-provided sources over OpenSSL. Also, standard libraries such as cmath, csv, date, dbm, and ipaddr have been promoted to gems.

Where to download Ruby 2.5

You can download version 2.5 by opening this tar.gz file or this Zip file.

IDG Insider

PREVIOUS ARTICLE

« Blade's Shadow cloud PC service reinvents cloud gaming one more time

NEXT ARTICLE

Intel responds to the CPU kernel bug, downplaying its impact on home users »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Recommended for You

International Women's Day: We've come a long way, but there's still an awfully long way to go

Charlotte Trueman takes a diverse look at today’s tech landscape.

Trump's trade war and the FANG bubble: Good news for Latin America?

Lewis Page gets down to business across global tech

20 Red-Hot, Pre-IPO companies to watch in 2019 B2B tech - Part 1

Martin Veitch's inside track on today’s tech trends

Poll

Do you think your smartphone is making you a workaholic?