Steps I take when optimizing the Rust compiler

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

内容简介: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


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

查看所有标签

猜你喜欢:

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

scikit learn机器学习

scikit learn机器学习

黄永昌 / 机械工业出版社 / 2018-3-1 / CNY 59.00

本书通过通俗易懂的语言、丰富的图示和生动的实例,拨开了笼罩在机器学习上方复杂的数学“乌云”,让读者以较低的代价和门槛轻松入门机器学习。本书共分为11章,主要介绍了在Python环境下学习scikit-learn机器学习框架的相关知识。本书涵盖的主要内容有机器学习概述、Python机器学习软件包、机器学习理论基础、k-近邻算法、线性回归算法、逻辑回归算法、决策树、支持向量机、朴素贝叶斯算法、PCA ......一起来看看 《scikit learn机器学习》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具