Skip to content

Translate 2.6.0-preview3 post (zh_cn) #1890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2018

Conversation

dsh0416
Copy link
Contributor

@dsh0416 dsh0416 commented Nov 22, 2018

No description provided.

@dsh0416 dsh0416 requested a review from a team as a code owner November 22, 2018 09:45

Ruby 2.6 引入了 `RubyVM::AST` 模块。

此模块提供 `parse` 方法,传入 Ruby 代码字符串,返回 AST(抽象语法树) 节点。而 `parse_file` 方法则接受一个 Ruby 代码文件作为参数,返回 AST 节点。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space before .


* 提升 `Proc#call` 的速度,因为我们无需再关心 `$SAFE`。[[功能 #14318]](https://bugs.ruby-lang.org/issues/14318)

通过 `lc_fizzbuzz` 多次使用 `Proc#call` 的基准测试我们测量到了 1.4 倍性能提升 [[漏洞 #10212]]((https://bugs.ruby-lang.org/issues/10212))。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial, just notice you interchangeably use benchmark and 基准测试, maybe just one?


Ruby 2.5 提升了代码块传递的性能。[[功能 #14045]](https://bugs.ruby-lang.org/issues/14045) 另外,Ruby 2.6 提升了传递代码块调用时的性能。通过 micro-benchmark 我们观察到了 2.6 倍性能提升。

* 引入了瞬态堆 (theap)。 [Bug #14858] [Feature #14989] 瞬态堆是用于管理指向特定类(Array, Hash, Object 和 Struct)短生命周期内存对象的堆。例如,创建小而短生命周期的哈希对象的速度提升到了 2x 快。根据 rdoc benchmark,我们观察到了 6% 到 7% 的性能提升。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x => 倍

@hlcfan
Copy link
Member

hlcfan commented Nov 23, 2018

Thanks @dsh0416!

@dsh0416 dsh0416 force-pushed the dsh0416/translate-2-6-0-preview3 branch from b6dde81 to 2c5c0e6 Compare November 24, 2018 08:01
@dsh0416
Copy link
Contributor Author

dsh0416 commented Nov 24, 2018

@hlcfan Thank you so much for your reviewing. The problems mentioned have been fixed.

@dsh0416 dsh0416 force-pushed the dsh0416/translate-2-6-0-preview3 branch from 2c5c0e6 to df84a02 Compare November 24, 2018 08:03
@dsh0416 dsh0416 changed the title Translate 2.6.0-preview3 posts (zh_cn) Translate 2.6.0-preview3 post (zh_cn) Nov 24, 2018
@dsh0416 dsh0416 force-pushed the dsh0416/translate-2-6-0-preview3 branch from df84a02 to 6664dca Compare November 24, 2018 08:28
@hlcfan
Copy link
Member

hlcfan commented Nov 25, 2018

👍

@hlcfan hlcfan merged commit dac9be9 into ruby:master Nov 25, 2018
@dsh0416 dsh0416 deleted the dsh0416/translate-2-6-0-preview3 branch October 29, 2019 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants