Steps I take when optimizing the Rust compiler

栏目: IT技术 · 发布时间: 5年前

内容简介:This commit makes the following writing improvements:And the following reading improvements:And the following improvements for both reading and writing:

This commit makes the following writing improvements:

write_to_vec

And the following reading improvements:

  • Removes an unnecessary type annotation.
  • Fixes a dangerous unchecked slice access. Imagine a slice [0x80] --
    the current code will read past the end of the slice some number of
    bytes. The bounds check at the end will subsequently trigger, unless
    something bad (like a crash) happens first. The cost of doing bounds
    check in the loop body is negligible.
  • Avoids a mask on the final byte.

And the following improvements for both reading and writing:

  • Changes for to loop for the loops, avoiding an unnecessary

    condition on each iteration. This also removes the need for

    leb128_size .

All of these changes give significant perf wins, up to 5%.

r? @michaelwoerister


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

乔纳森传

乔纳森传

利恩德·卡尼 / 汪琪 岳卉 王文雅 / 中信出版社 / 2014-1-1 / 49

抛开苹果公司,单就设计行业来讲,乔纳森也是一个特殊的人物。他推动了设计行业的大变革:不再为产品增加看起来炫得多的配件,而是要去掉多余的东西。 ——陈向东 终于有一本书能够如此地接地气:它不再关注那位神一样的乔布斯,而是关注那位站在神的背后,同样具有神一样光环的乔纳森。 ——孙陶然 乔纳森•艾夫把他自己对科学、人文、艺术,乃至整个世界的感知尽数渗透进苹果的设计和审美之中,他是......一起来看看 《乔纳森传》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具