Skip to content

Commit e61c206

Browse files
committed
Ruby 2.6.0-preview1 Released
1 parent eef13f7 commit e61c206

File tree

2 files changed

+193
-0
lines changed

2 files changed

+193
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
layout: news_post
3+
title: "Ruby 2.6.0-preview1 Released"
4+
author: "naruse"
5+
translator:
6+
date: 2018-02-24 00:00:00 +0000
7+
lang: en
8+
---
9+
10+
We are pleased to announce the release of Ruby 2.6.0-preview1.
11+
12+
Ruby 2.6.0-preview1 is the first preview toward Ruby 2.6.0.
13+
This preview1 is released earlier than usual because it includes an important new feature, JIT.
14+
15+
## JIT
16+
17+
Ruby 2.6 introduces an initial implementation of JIT (Just-in-time) compiler.
18+
19+
JIT compiler aims to improve performance of any Ruby program execution.
20+
Unlike ordinary JIT compilers for other languages, Ruby's JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code.
21+
See also: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization
22+
23+
How to use: Just specify "--jit" in command line or $RUBYOPT environment variable.
24+
Specifying "--jit-verbose=1" allows to print basic information of ongoing JIT compilation. See "ruby --help" for other options.
25+
26+
The main purpose of this JIT release is to provide a chance to check if it works for your platform and to find out security risks before the 2.6 release.
27+
Currently JIT compiler is supported only when Ruby is built by gcc or clang and the compiler is available on runtime. Otherwise you can't use it for now.
28+
29+
As of 2.6.0-preview1, we're just preparing infrastructure for JIT and very few optimizations are implemented.
30+
You can measure some of potential improvements in micro benchmarks with this release, but it is NOT ready for benchmarking final performance of Ruby's JIT compiler, especially for larger programs like Rails applications.
31+
32+
We're going to implement method iniling in JIT compiler, which is expected to increase Ruby's performance in order of magnitude.
33+
Also, we're planning to increase the supported platforms, and the next plan is to support Visual Studio.
34+
35+
Stay tuned for the new age of Ruby's performance.
36+
37+
## New Features
38+
39+
* Add Random.bytes. [Feature #4938]
40+
NOTE: 小粒な変更だけど賑やかしのために入れる。preview2ではけす
41+
42+
* Add Binding#source_location. [Feature #14230]
43+
* This method returns the source location of binding, a 2-element array of `__FILE__` and `__LINE__`. Traditionally, the same information could be retrieved by `eval("[__FILE__, __LINE__]", binding)`, but we are planning to change this behavior so that `Kernel#eval` ignores binding's source location [Bug #4352]. So, users should use this newly-introduced method instead of `Kernel#eval`.
44+
45+
* Add :exception option to let Kernel.#system raise error instead of returning false. [Feature #14386]
46+
47+
## Performance improvements
48+
49+
* Speedup `Proc#call` because we dont' need to care about `$SAFE` any more.
50+
[Feature #14318]
51+
With `lc_fizzbuzz` benchmark which uses `Proc#call` so many times we can measure
52+
x1.4 improvements [Bug #10212].
53+
54+
* Speedup `block.call` where `block` is passed block parameter. [Feature #14330]
55+
Ruby 2.5 improves block passing performance. [Feature #14045]
56+
Additionally, Ruby 2.6 improves the performance of passed block calling.
57+
With micro-benchmark we can observe x2.6 improvemnt.
58+
59+
## Other notable changes since 2.5
60+
61+
* $SAFE is a process global state and we can set 0 again. [Feature #14250]
62+
63+
* Passing safe_level to ERB.new is deprecated. trim_mode and eoutvar arguments are changed to keyword arguments. [Feature #14256]
64+
65+
* Merge RubyGems 2.7.6
66+
67+
See [NEWS](https://github.com/ruby/ruby/blob/v2_6_0_preview1/NEWS)
68+
or [commit logs](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview1)
69+
for details.
70+
71+
With those changes,
72+
[1115 files changed, 23023 insertions(+), 14748 deletions(-)](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview1)
73+
since Ruby 2.5.0!
74+
75+
Today, Feburary 24th, is Ruby's 25th birthday.
76+
Happy birthday Ruby, and enjoy programming with Ruby 2.6.0-preview1!
77+
78+
## Download
79+
80+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.gz>
81+
82+
SIZE: 16082501 bytes
83+
SHA1: 94b4a2f5f992dc9855364284e9c64316bf129c90
84+
SHA256: 2023c42676d9237481e1a97157d5e2ecc10db5e320d5b9cf872ec1d293265d61
85+
SHA512: 004696c4f087333ba7cb2285418dcce70f399966ae8fed817aab9759fd2d75beb088c4aeb294fcd4260112e8422f490cd4dbdfce402d73f96bb679b8bb3e1607
86+
87+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.zip>
88+
89+
SIZE: 19807007 bytes
90+
SHA1: 24d76f67bf913348eca783a2ecf6f3faf37299ae
91+
SHA256: 6c883927e80430cf07f2d90728d6c2c71164223f378a48ebf964d3b66319f623
92+
SHA512: 1e7f318cec1b7875fd9891df671078de7585b556695a2a85708483ddcacfd6e0b63b70ec2535e92ff981b4f72063721ed552df49688e066666fcd7ae520ae667
93+
94+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.bz2>
95+
96+
SIZE: 14104578 bytes
97+
SHA1: 9f0fb79643a4673a839b0c8496eccc6e1dbd022d
98+
SHA256: 8bd6c373df6ee009441270a8b4f86413d101b8f88e8051c55ef62abffadce462
99+
SHA512: d9cb270529a97670d54f43a0236fab072714e715c39277dab70b7a1843ec818e6700e47e1384c7256f9e0ae41ab2c0b768a0de38a5ecf4f4fff5da6ef5ad4944
100+
101+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.xz>
102+
103+
SIZE: 11423984 bytes
104+
SHA1: bbbc89d760cdaadbca3cbff587295864edeff0af
105+
SHA256: 1d99139116e4e245ce543edb137b2a8873c26e9f0bde88d8cee6789617cc8d0e
106+
SHA512: d12ff29778d8d940344619881b4d8247c2fb6b44ac2b2dbddb7078828e893cfac9a5a95b5588f0afdbed52bdb6dea95cff1b9ce3ad47dfa62209e97dab8810b6
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
layout: news_post
3+
title: "Ruby 2.6.0-preview1 リリース"
4+
author: "naruse"
5+
translator:
6+
date: 2018-02-24 00:00:00 +0000
7+
lang: ja
8+
---
9+
10+
Ruby 2.6.0に向けた最初のプレビューである、Ruby 2.6.0-preview1がリリースされました。
11+
12+
Ruby 2.6.0-preview1は、重要な新機能であるJITを含むため、例年よりも早期にリリースすることにしました。
13+
その一部を以下に紹介します。
14+
15+
## JIT
16+
17+
Ruby 2.6ではJIT (Just-in-time) コンパイラが導入されました。
18+
19+
JITコンパイラはあらゆるRubyプログラムの実行を高速化することを目的としています。
20+
他言語の一般的なJITコンパイラと異なり、RubyのJITコンパイラはC言語のソースコードをファイルとしてディスクに書き、通常のCコンパイラを用いてネイティブコードに変換することでJITコンパイルを行うという手法を用いています。(参考: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization)
21+
22+
JITコンパイルを有効にするには `--jit` オプションをコマンドラインまたは$RUBYOPT環境変数を指定します。`--jit-verbose=1`を指定すれば指定すれば実行中のJITコンパイルの基本的な情報を表示します。その他のオプションについては `ruby --help` を参照ください。
23+
24+
今回のリリースはこのJITコンパイル機能を皆さんの環境で動作を確認して頂くとともに、セキュリティ上の問題が無いかを早期に確認するために行っています。
25+
現在のJITコンパイラはいくつか制限があり、まずgccまたはclangによってビルドされたRubyでかつ、そのコンパイラが実行時に利用可能である必要があります。また、現在はJITコンパイルの基盤を準備している段階で、少数の最適化のみ実装しています。そのため現在でもいくつかのマイクロベンチマークでは潜在的な速度改善が見られるものの、より大きなプログラム、特にRailsアプリケーションなどではJITコンパイラの性能を計測出来る段階ではありません。
26+
27+
今後はインライン化等を実装することでRubyの性能を桁違いに向上させます。また、Visual Studioを筆頭に、サポートする環境も増やしていきます。
28+
29+
引き続き新時代のRubyの実効性能にご期待ください。
30+
31+
## 新機能
32+
33+
* Random.bytes の追加 [Feature #4938]
34+
* Binding#source_location の追加 [Feature #14230]
35+
* `binding`のソースコード上の位置を `__FILE__``__LINE__` の二要素配列として返します。従来でも `eval("[__FILE__, __LINE__]", binding)` とすることでこれらの情報は得られましたが、将来的に `Kernel#eval` はbindingのソースコード行を無視する変更を予定しているため [Bug #4352]、この新しいメソッドを用いることが今後は推奨されます。
36+
* Kernel#system の失敗時に、falseを返す代わりに例外を上げさせる :exception オプションを追加 [Feature #14386]
37+
38+
## パフォーマンスの改善
39+
40+
* 後述の$SAFEの変更に伴って考慮すべきことが減ったため、`Proc#call`が高速化されました [Feature #14318]
41+
`Proc#call` を大量に呼び出す `lc_fizzbuzz` ベンチマークにおいては、1.4倍高速化されています [Bug #10212].
42+
* `block` がブロックパレメータである時、`block.call`が高速化されました [Feature #14330]
43+
Ruby 2.5ではブロック渡しの性能が改善されましたが [Feature #14045]、加えてRuby 2.6では渡されたブロックの呼び出しも改善されました。
44+
マイクロベンチマークにおいては2.6倍高速化されています。
45+
46+
## その他の注目すべき 2.5 からの変更点
47+
48+
* $SAFE はプロセスグローバルで扱われることになると共に、0以外を設定した後に0に戻せるようになりました [Feature #14250]
49+
* `ERB.new``safe_level`を渡すのは非推奨になりました。また、`trim_mode``eoutvar`はキーワード引数に変更されました。 [Feature #14256]
50+
* RubyGems 2.7.6 をマージしました
51+
52+
その他詳細については、[NEWS](https://github.com/ruby/ruby/blob/v2_6_0_preview1/NEWS) ファイルまたは[コミットログ](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview1)を参照してください。
53+
54+
なお、こうした変更により、Ruby 2.5.0 以降では [1115 個のファイルに変更が加えられ、23023 行の追加と 14748 行の削除が行われました](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview1) !
55+
56+
今日、2月24日はRubyの25年目の誕生日です。
57+
誕生日おめでとう! みなさんもRuby 2.6.0-preview1で楽しいプログラミングを!
58+
59+
## Download
60+
61+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.gz>
62+
63+
SIZE: 16082501 bytes
64+
SHA1: 94b4a2f5f992dc9855364284e9c64316bf129c90
65+
SHA256: 2023c42676d9237481e1a97157d5e2ecc10db5e320d5b9cf872ec1d293265d61
66+
SHA512: 004696c4f087333ba7cb2285418dcce70f399966ae8fed817aab9759fd2d75beb088c4aeb294fcd4260112e8422f490cd4dbdfce402d73f96bb679b8bb3e1607
67+
68+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.zip>
69+
70+
SIZE: 19807007 bytes
71+
SHA1: 24d76f67bf913348eca783a2ecf6f3faf37299ae
72+
SHA256: 6c883927e80430cf07f2d90728d6c2c71164223f378a48ebf964d3b66319f623
73+
SHA512: 1e7f318cec1b7875fd9891df671078de7585b556695a2a85708483ddcacfd6e0b63b70ec2535e92ff981b4f72063721ed552df49688e066666fcd7ae520ae667
74+
75+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.bz2>
76+
77+
SIZE: 14104578 bytes
78+
SHA1: 9f0fb79643a4673a839b0c8496eccc6e1dbd022d
79+
SHA256: 8bd6c373df6ee009441270a8b4f86413d101b8f88e8051c55ef62abffadce462
80+
SHA512: d9cb270529a97670d54f43a0236fab072714e715c39277dab70b7a1843ec818e6700e47e1384c7256f9e0ae41ab2c0b768a0de38a5ecf4f4fff5da6ef5ad4944
81+
82+
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.xz>
83+
84+
SIZE: 11423984 bytes
85+
SHA1: bbbc89d760cdaadbca3cbff587295864edeff0af
86+
SHA256: 1d99139116e4e245ce543edb137b2a8873c26e9f0bde88d8cee6789617cc8d0e
87+
SHA512: d12ff29778d8d940344619881b4d8247c2fb6b44ac2b2dbddb7078828e893cfac9a5a95b5588f0afdbed52bdb6dea95cff1b9ce3ad47dfa62209e97dab8810b6

0 commit comments

Comments
 (0)