Skip to content

Commit 169ba62

Browse files
committed
Improves 2.6.0-preview1 post (en, ja)
- fix typos - wraps code in code tags - list item description - linkify Vladimir's MJIT branch
1 parent daba294 commit 169ba62

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

en/news/_posts/2018-02-24-ruby-2-6-0-preview1-released.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,51 @@ Ruby 2.6 introduces an initial implementation of JIT (Just-in-time) compiler.
1818

1919
JIT compiler aims to improve performance of any Ruby program execution.
2020
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
21+
See also: [Vladimir Makarov's mjit-organization branch](https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization).
2222

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.
23+
How to use: Just specify `--jit` in command line or `$RUBYOPT` environment variable. Specifying `--jit-verbose=1` allows to print basic information of ongoing JIT compilation. See `ruby --help` for other options.
2524

2625
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.
2726
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.
2827

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.
28+
As of 2.6.0-preview1, we're just preparing infrastructure for JIT and very few optimizations are implemented. 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 large programs like Rails applications.
3129

3230
We're going to implement method iniling in JIT compiler, which is expected to increase Ruby's performance in order of magnitude.
31+
3332
Also, we're planning to increase the supported platforms, and the next plan is to support Visual Studio.
3433

3534
Stay tuned for the new age of Ruby's performance.
3635

3736
## New Features
3837

39-
* Add Random.bytes. [Feature #4938]
38+
* Add `Random.bytes`. [Feature #4938]
39+
* Add `Binding#source_location`. [Feature #14230]
4040

41-
* Add Binding#source_location. [Feature #14230]
42-
* 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`.
41+
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`.
4342

44-
* Add :exception option to let Kernel.#system raise error instead of returning false. [Feature #14386]
43+
* Add `:exception` option to let `Kernel.#system` raise error instead of returning `false`. [Feature #14386]
4544

4645
## Performance improvements
4746

4847
* Speedup `Proc#call` because we dont' need to care about `$SAFE` any more.
4948
[Feature #14318]
49+
5050
With `lc_fizzbuzz` benchmark which uses `Proc#call` so many times we can measure
5151
x1.4 improvements [Bug #10212].
5252

5353
* Speedup `block.call` where `block` is passed block parameter. [Feature #14330]
54+
5455
Ruby 2.5 improves block passing performance. [Feature #14045]
5556
Additionally, Ruby 2.6 improves the performance of passed block calling.
56-
With micro-benchmark we can observe x2.6 improvemnt.
57+
With micro-benchmark we can observe 2.6x improvemnt.
5758

5859
## Other notable changes since 2.5
5960

60-
* $SAFE is a process global state and we can set 0 again. [Feature #14250]
61+
* `$SAFE` is a process global state and we can set `0` again. [Feature #14250]
6162

62-
* Passing safe_level to ERB.new is deprecated. trim_mode and eoutvar arguments are changed to keyword arguments. [Feature #14256]
63+
* Passing `safe_level` to `ERB.new` is deprecated. `trim_mode` and `eoutvar` arguments are changed to keyword arguments. [Feature #14256]
6364

64-
* Merge RubyGems 2.7.6
65+
* Merged RubyGems 2.7.6
6566

6667
See [NEWS](https://github.com/ruby/ruby/blob/v2_6_0_preview1/NEWS)
6768
or [commit logs](https://github.com/ruby/ruby/compare/v2_5_0...v2_6_0_preview1)

ja/news/_posts/2018-02-24-ruby-2-6-0-preview1-released.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Ruby 2.6.0-preview1は、重要な新機能であるJITを含むため、例年
1717
Ruby 2.6ではJIT (Just-in-time) コンパイラが導入されました。
1818

1919
JITコンパイラはあらゆるRubyプログラムの実行を高速化することを目的としています。
20-
他言語の一般的なJITコンパイラと異なり、RubyのJITコンパイラはC言語のソースコードをファイルとしてディスクに書き、通常のCコンパイラを用いてネイティブコードに変換することでJITコンパイルを行うという手法を用いています。(参考: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization)
20+
他言語の一般的なJITコンパイラと異なり、RubyのJITコンパイラはC言語のソースコードをファイルとしてディスクに書き、通常のCコンパイラを用いてネイティブコードに変換することでJITコンパイルを行うという手法を用いています。(参考: [Vladimir Makarovのmjit-organizationブランチ](https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#mjit-organization))
2121

22-
JITコンパイルを有効にするには `--jit` オプションをコマンドラインまたは$RUBYOPT環境変数を指定します`--jit-verbose=1`を指定すれば指定すれば実行中のJITコンパイルの基本的な情報を表示します。その他のオプションについては `ruby --help` を参照ください。
22+
JITコンパイルを有効にするには `--jit` オプションをコマンドラインまたは`$RUBYOPT`環境変数を指定します`--jit-verbose=1`を指定すれば指定すれば実行中のJITコンパイルの基本的な情報を表示します。その他のオプションについては `ruby --help` を参照ください。
2323

2424
今回のリリースはこのJITコンパイル機能を皆さんの環境で動作を確認して頂くとともに、セキュリティ上の問題が無いかを早期に確認するために行っています。
2525
現在のJITコンパイラはいくつか制限があり、まずgccまたはclangによってビルドされたRubyでかつ、そのコンパイラが実行時に利用可能である必要があります。また、現在はJITコンパイルの基盤を準備している段階で、少数の最適化のみ実装しています。そのため現在でもいくつかのマイクロベンチマークでは潜在的な速度改善が見られるものの、より大きなプログラム、特にRailsアプリケーションなどではJITコンパイラの性能を計測出来る段階ではありません。
@@ -30,22 +30,27 @@ JITコンパイルを有効にするには `--jit` オプションをコマン
3030

3131
## 新機能
3232

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]
33+
* `Random.bytes` の追加 [Feature #4938]
34+
* `Binding#source_location` の追加 [Feature #14230]
35+
36+
`binding`のソースコード上の位置を `__FILE__``__LINE__` の二要素配列として返します。従来でも `eval("[__FILE__, __LINE__]", binding)` とすることでこれらの情報は得られましたが、将来的に `Kernel#eval` はbindingのソースコード行を無視する変更を予定しているため [Bug #4352]、この新しいメソッドを用いることが今後は推奨されます。
37+
38+
* `Kernel#system` の失敗時に、`false`を返す代わりに例外を上げさせる :exception オプションを追加 [Feature #14386]
3739

3840
## パフォーマンスの改善
3941

40-
* 後述の$SAFEの変更に伴って考慮すべきことが減ったため、`Proc#call`が高速化されました [Feature #14318]
42+
* 後述の`$SAFE`の変更に伴って考慮すべきことが減ったため、`Proc#call`が高速化されました [Feature #14318]
43+
4144
`Proc#call` を大量に呼び出す `lc_fizzbuzz` ベンチマークにおいては、1.4倍高速化されています [Bug #10212].
45+
4246
* `block` がブロックパレメータである時、`block.call`が高速化されました [Feature #14330]
47+
4348
Ruby 2.5ではブロック渡しの性能が改善されましたが [Feature #14045]、加えてRuby 2.6では渡されたブロックの呼び出しも改善されました。
4449
マイクロベンチマークにおいては2.6倍高速化されています。
4550

4651
## その他の注目すべき 2.5 からの変更点
4752

48-
* $SAFE はプロセスグローバルで扱われることになると共に、0以外を設定した後に0に戻せるようになりました [Feature #14250]
53+
* `$SAFE` はプロセスグローバルで扱われることになると共に、`0`以外を設定した後に0に戻せるようになりました [Feature #14250]
4954
* `ERB.new``safe_level`を渡すのは非推奨になりました。また、`trim_mode``eoutvar`はキーワード引数に変更されました。 [Feature #14256]
5055
* RubyGems 2.7.6 をマージしました
5156

@@ -56,7 +61,7 @@ JITコンパイルを有効にするには `--jit` オプションをコマン
5661
今日、2月24日はRubyの25年目の誕生日です。
5762
誕生日おめでとう! みなさんもRuby 2.6.0-preview1で楽しいプログラミングを!
5863

59-
## Download
64+
## ダウンロード
6065

6166
* <https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.0-preview1.tar.gz>
6267

0 commit comments

Comments
 (0)