首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

【译】如何提升 Rust 代码性能

性能是开发者为其应用程序选择 Rust 的首要原因之一。事实上,它是 rust-lang.org 主页上 ["为什么选择Rust?"](https://www.rust-lang.org/#:~:text=Version%201.55.0-,Why%20Rust%3F,-Performance ""为什么选择Rust?"")一节中列出的第一个原因,甚至在内存安全之前。这也是有原因的,许多基准测试表明,用Rust编写的软件速度很快,有时甚至是最快[2]的。但这并不意味着所有用Rust编写的软件都能保证快速。事实上,写低性能的Rust代码是很容易的,特别是当试图通过Clone 或Arc替代借用来""安抚""借用检查器时,这种策略通常被推荐给 Rust 新手。这就是为什么对 Rust 代码进行剖析和基准测试是很重要的,可以看到任何瓶颈在哪里,并修复它们,就像在其他语言中那样。在这篇文章中,我将根据最近的工作经验,展示一些基本的工具和技术,以提高 mongodb crate 的性能。

02

ubuntu7.10安装到3D开启

累了好几天,重装了十几遍终于把ubuntu7.10搞定到了我自认为完美的状态了。现在总结一下安装过程(按操作顺序记录): 1.在xp下不管用pqmajac还是其他硬盘分区工具分出10G的空余分区来(实验阶段10G尝试下),不知道是不是必须得把空余分区放到硬盘的最后,似乎用中间分区会出现安装错误。 2.开始安装,简单步骤省略...这里注意的是分区时,一个swap:2G,logical,结束。一个/,ext3,8G,开始。还有就是安装过程中保持网络通畅,因为过程中要下载语言包支持。 3.安装结束。 ----------- 为了避免在以后的配置过程中出现错误,这里推荐用clonezilla live(ghost 4 linux)做备份,clonezilla下载地址:[url]http://clonezilla.sourceforge.net/download/sourceforge/[/url] 下载*.iso刻张碟子出来,从碟子启动进入clonezilla live进行备份,使用还是相当简单的。 ----------- 4.用clonezilla live做一次备份,起名original 5.装好ubuntu7.10后,第一件事情就是安装源了: sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup sudo gedit /etc/apt/sources.list 将内容全部替换成: deb [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy main restricted universe multiverse deb-src [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy main restricted universe multiverse deb [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-backports main restricted universe multiverse deb-src [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-backports main restricted universe multiverse deb [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-proposed main restricted universe multiverse deb-src [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-proposed main restricted universe multiverse deb [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-security main restricted universe multiverse deb-src [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-security main restricted universe multiverse deb [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-updates main restricted universe multiverse deb-src [url]http://ubuntu.cn99.com/ubuntu[/url] gutsy-updates main restricted universe multiverse ----更新软件包: sudo apt-get update sudo apt-get dist-upgrade --------------------------------这里更新软件包需要漫长的时间(取决于网速了) 可以在这个时候作一些比较简单的配置: ------------ 把桌面,把计算机、主文件夹、回收站放到桌面上,把挂载的卷去掉: gconf-editor 到/apps/nautilus/desktop/分支下,去掉volumes_visible前面的复选框,勾上trash_icon_visible,home_icon_visible,computer_icon_visible前面的复选框。 ------------ 调整上下任务栏里面的内容 ------------ 开通root登录: 1.修改root密码: sudo passwd root 2.系统->系统管理->登录窗口,在安全选项卡里“允许本地系统管理员登录”打勾 以后就可以通过切换用户从登录窗口用root权限登录

08
领券