编程语言与软件工程2015octarineparrot.com
HPC 环境下 C、Go 与 Rust 的评估
Evaluation of C, Go, and Rust in the HPC environment
入门 · 约 60 分钟读完前置知识:C 语言基础、Rust 或 Go 基础、并行计算基础
导读
这是一篇本科毕业论文,比较 C、Go 和 Rust 在 HPC(高性能计算)环境下的表现,通过将一个程序分别用三种语言实现并对比性能、开发时间和代码量。结论认为 Go 和 Rust 性能相近,但论文本身存在明显方法学问题,例如 C 版本的部分支持库未开启优化编译,导致部分性能对比结果不可靠。
HN 关注点:三种语言在 HPC 场景下的实际对比,但讨论焦点很快转向这篇本科论文的方法学缺陷和结论是否可信。
HN 评论精选
这几条评论里:质疑 2 补充 2
质疑批评论文样本量过小、作者经验不对等,结论没有参考价值
作者在三种被评估语言(尤其是 C)上经验不对等,却基于一名开发者和一个很小的程序来比较开发时间和代码行数,样本量只有 1。他把分布式程序改写成了线程版,因为 Rust 和 Go 没有分布式计算库,却声称 Go 和 Rust 在 HPC 中性能'相似'。他说对 C 的性能感到惊讶,却没有调查原因。我不想过分苛责,但这些结果毫无意义,是浪费时间。
bsdetector查看英文原文
The author has a "lack of equal experience in the three evaluated languages", especially C, but is comparing them for development time and SLOC based on a sample size of one developer and one very small program. He rewrites a distributed program as a threaded one, because Rust and Go didn't have a distributed computing library, but says Go and Rust have "similar performance" in HPC. He says he was surprised at the C performance, but there's no investigation of a cause. Maybe just because C is slow... I don't mean to be overly critical, but these results in the paper mean absolutely nothing. It's a waste of time.
质疑指出 C 版本支持库未开优化编译,导致性能对比结果失真
以本科论文形式阅读的问题在于它还没经过足够严格的检验。与 C 对比的大部分性能结果是错的,因为(论文自己也承认了)作者不小心把 C 版本的一些重要支持库在未开优化的情况下编译,然后部署到了集群上。论文原文:'如前一章所述,这个性能退化可能是由在开发笔记本上编译并拷贝到集群的两个未优化库导致的。'
dgacmu查看英文原文
The problem with reading this in BS thesis form is that it hasn't gone through the wringer enough. Most of the performance comparison results vs C are bogus because (to its credit, as noted), the author accidentally compiled some important support libraries for the C version without optimization and used those on the cluster. Oopsie. As briefly mentioned in the previous chapter this performance regression might have been caused by the two unoptimized libraries that were compiled on the development laptop and copied to the cluster.
补充以导师视角评价:作为本科练习不错,但不是严谨的研究成果
记住这是一篇本科毕业论文,不是权威系统期刊或会议上的同行评审论文。这有正反两面:正面来说,本科论文的目的是让本科生接触一个有研究成分的、自主的长期项目。作为指导过很多这类项目的人,我认为这篇写得相当不错,干得好!但同时,作者是要修满课业的本科生,所以这不是高质量的研究发表,结果可能不太稳,方法也可能有些偏差。不过没关系,每件优秀的工作都得有个起点。
deadgrey19查看英文原文
Keep in mind, this is a bachelors thesis. It's not a peer reviewed research article in a respected systems journal or conference. I mean this in both a positive and a negative sense. Positive in sense that the purpose of a bachelors thesis is to introduce undergraduates to an extended, self directed project with an element of research to it. As someone who has supervised many such projects, I think that this is a pretty good one. Great work! At the same time, since the author is an undergraduate, presumably with a full coarse load, this is not a high quality research publication. The results are probably a bit shaky and the methodology is perhaps a bit off. But that's ok. Every excellent piece of work has to start somewhere.
补充补充代码仓库链接,并指出 Rust 版本发现其他实现中关键错误这一亮点
所有代码的 GitHub 仓库:https://github.com/mrfloya/thesis-ba。论文中我觉得最有意思的是第 42 页:'在这种情况下,Rust 版本最后开发反而成了优势,因为它揭示了其他实现中的一个关键错误。'空指针又立功了!
steveklabnik查看英文原文
GitHub repo with all of the code: https://github.com/mrfloya/thesis-ba Most interesting part of the thesis, for me, is page 42: > In this case it was even an advantage that the Rust version was developed last since it revealed a critical error in the other implementations. Null strikes again!
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2015Hacker News 讨论帖145 分 · 64 评
同领域还值得读
Google 的软件工程(2017)
Software Engineering at Google (2017)
介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…
编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选Peter Naur:编程作为理论构建 (1985)
Peter Naur – Programming as Theory Building (1985)
Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…
编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选SciPy 1.0:Python 科学计算的基础算法
SciPy 1.0: fundamental algorithms for scientific computing in Python
这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社…
编程语言与软件工程2020 · 387 分 · 98 评入门 · 约 45 分钟编辑精选Lisp 的历史(1979)
History of Lisp (1979)
这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…
编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选使用 NumPy 进行数组编程
Array Programming with NumPy
这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。
编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选