• 基因科技走入中国民生 坚持自主创新 2018-05-27
  • 文在寅政府首次就“文化界黑名單”向國民道歉 2018-05-27
  • 【美丽中国长江行】常德桃源:做好水文章,答对生态卷 2018-05-26
  • 农业农村部“百乡万户”驻村调研:兴农业 补短板 2018-05-26
  • 女人更年期后,要不要避孕?如何避? 2018-05-25
  • 债市风险有多大?华商系债基今年跌幅已超20% 2018-05-25
  • 供电公司采取小额诉讼手段维权 3个月不交电费将收到律师函 2018-05-25
  • 智能公交让全民体验智慧出行 2018-05-25
  • 杭州男子钓起16斤重“猛兽”,专家一看:可别随意丢弃! 2018-05-25
  • 望川十年,看见中国社会的成长 2018-05-25
  • 哈尔滨市“拔钉子”严查露天烧烤 21家冒烟摊位将被依法处罚 2018-05-24
  • 新濠天地娱乐城官网 2018-05-24
  • “澳门368足球博彩公司”足球比分及时直播李国英主持召开省深化医药卫生体制改革领导小组会议 2018-05-23
  • 马来大选92岁前总理改写政治版图 60年来政党首轮替 2018-05-23
  • 科技创新技能挑战赛聚焦冬奥主题 2018-05-23
  • Ruby 2.5.0 发布,提升 5-10% 性能

    栏目: 软件资讯 发布于: 2017-12-26 10:00:03

    新版包括了一系列新的特性和性能改进。主要变化包括:rescue/else/ensure 允许直接与 do/end 块使用,yield 增加 yield_self,Struct.new 能创建接受关键字参数的类,最高级常量查询不再可用,移除所有 trace 指令提升 5-10% 性能,SecureRandom 将更偏向使用操作系统提供的 SSL 库

    新特性

    • rescue/else/ensure 允许直接与 do/end 块使用。?[Feature #12906]

    • yield 增加 yield_self。?[Feature #6721]

    • 支持分行覆盖范围和方法覆盖率测量。The branch coverage indicates which branches are executed and which are not. The method coverage indicates which methods are invoked and which are not. By running the test suite with these new features, you will know which branches and methods are executed, and evaluate total coverage of the test suite more strictly.?[Feature #13901]

    • Hash#slice?[Feature #8499]?and Hash#transform_keys?[Feature #13583]

    • Struct.new 能创建接受关键字参数的类。?[Feature #11925]

    • 枚举 #any?,all?,none? and one? 接收模式参数?[Feature #11286]

    • 顶层常量查找不可用。[Feature #11547]

    • pp.rb 现在自动加载。?[Feature #14123]

    • Print backtrace and error message in reverse order (oldest call first, most recent call last). When a long backtrace appears on your terminal (TTY), you can easily find the cause line at the bottom of the backtrace. Note that the order is reversed only when backtrace is printed out to the terminal directly.?[Feature #8661]?[experimental]

    性能提升

    • About 5-10% performance improvement by removing all?trace?instructions from overall bytecode (instruction sequences).The?trace?instruction was added to support the?TracePoint. However, in most cases,?TracePoint?is not used and?trace?instructions are pure overhead. Instead, now we use a dynamic instrumentation technique. See?[Feature #14104]?for more details.

    • Block passing by a block parameter (e.g.?def foo(&b); bar(&b); end) is about 3 times faster than Ruby 2.4 by “Lazy Proc allocation” technique.?[Feature #14045]

    • Mutex is rewritten to be smaller and faster.?[Feature #13517]

    • ERB now generates code from a template which runs twice as fast as Ruby 2.4.

    • Improve performance of some built-in methods including?Array#concat,?Enumerable#sort_by,?String#concat,?String#index,?Time#+?and more.

    • IO.copy_stream uses copy_file_range(2) to copy offload?[Feature #13867]

    其他稳定改进

    • SecureRandom now prefers OS-provided sources over OpenSSL.?[Bug #9569]

    • Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib from standard libraries to default gems.

    • Update to?Onigmo?6.1.3.

    • Update to Psych 3.0.2.

    • Update to RubyGems 2.7.3.

    • Update to RDoc 6.0.1.

      • Switchthelexer from IRB based one to Ripper. This dramatically improves the performance of document generation.

      • Fix a significant amount of bugs that existed over ten years.

      • Add support for new Ruby syntax from the latest versions.

    • Update supported Unicode version to 10.0.0.

    • Thread.report_on_exception?is now set to true by default. This change helps debugging of multi-threaded programs.?[Feature #14143]

    • IO#write now receives multiple arguments?[Feature #9323]

    更多内容请查看?NEWS?或者?commit logs?。


    【声明】文章转载自:开源中国社区 [http://www.rocksun.cn]

    本站文章除注明转载外,均为本站原创或编译?;队魏涡问降淖?,但请务必注明出处。
    转载请注明:文章转载自 七星彩票平台
    本文标题:Ruby 2.5.0 发布,提升 5-10% 性能
    IT技术书籍推荐:
    GitHub入门与实践
    GitHub入门与实践
    大塚弘记 (作者), 支鹏浩 (译者), 刘斌 (译者)
    《GitHub入门与实践》从Git的基本知识和操作方法入手,详细介绍了GitHub的各种功能,GitHub与其他工具或服务的协作,使用GitHub的开发流程以及如何将GitHub引入到企业中。在讲解GitHub的代表功能Pull Request时,本书专门搭建了供各位读者实践的仓库,邀请各位读者进行Pull Request并共同维护。 《GitHub入门与实践》旨在指导各位读者如何在开发现场使用GitHub进行高效开发,适合所有想要使用GitHub进行开发的程序员或团队阅读。