工具与资源github.com
Hyperfine:命令行基准测试工具
Hyperfine: A command-line benchmarking tool
2018 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Hyperfine 是一个命令行基准测试工具,用来对命令进行多次运行并统计耗时,方便比较不同命令或参数的性能。它比直接用 time 更系统,但评论也提醒:单纯计时并不等于有效基准测试,还需要理解程序行为和瓶颈。
为什么经久不衰:它把粗糙的 time 测量变成可重复、可统计的命令行基准,简单易用,至今仍是快速性能对比的常用入口。
HN 评论精选
仅计时不足以构成有效基准,需理解程序行为与瓶颈。
不错!比直接用 time 更进一步。不过一般来说,给事情计时并不能成为有效的基准测试。如果不理解程序在做什么,就不明白什么在影响结果,也无法知道真实场景中会怎样不同。一个进程单线程更快还是低核数更快,另一个大规模并行、直到扩展更高才胜出?你的命令测的是你以为的东西吗?瓶颈是什么?如果你不知道结果为何如此,而不是更高,你就没有好的基准。
cthalupa查看英文原文
Nifty! Step up over just using time. Unfortunately, timing things in general isn't going to be a very effective benchmark. Without understanding what a program is doing, you don't understand what is impacting your results, and have no real knowledge on how things are going to differ when you go to use them in the "real world". Is one process faster when single threaded vs. a low core count, but another is massively parallel, and loses out until scaled higher? Are your commands testing the thing you think they're testing? What is your limiting factor? If you don't know why the results are what they are, instead of higher, you don't have a good benchmark. http://www.brendangregg.com/activebenchmarking.html / http://www.brendangregg.com/ActiveBenchmarking/bonnie++.html
缓存会极大影响 I/O 基准,多次运行分析很有用。
不错,看起来很方便,尤其是对多次运行的分析。今天我在玩 /proc/sys/vm/drop_caches,之前从没用过,它让从机械盘读取差别巨大!例如用 8 个进程读取数万个文件,耗时 real 5m33.048s;然后不清缓存再跑同一命令,耗时 real 0m6.502s。
anfractuosity查看英文原文
Nice, that looks very handy especially the analysis of multiple runs. Just today I was playing with /proc/sys/vm/drop_caches, I'd never used it before, it makes a massive difference reading from a spinning disk! For example to read tens of thousands of files (using 8 processes), it would take me real 5m33.048s Then if I ran the command again, without flushing the cache, it'd take: real 0m6.502s
建议交错执行以减少外部干扰对比较结果的影响。
当给定多个命令时,它能否交错执行,而不是一个接一个地测?比较两个相似命令时这有用,因为交错可降低负载尖峰只不利影响其中一个,或因热节流负面影响最后一个命令的可能性。
CyberShadow查看英文原文
When given multiple commands, can it interleave executions instead of benchmarking them one after the other? This would be useful when comparing two similar commands, as interleaving them makes it less likely that e.g. a load spike will unfavorably affect only one of them, or due to e.g. thermal throttling negatively affecting the last command.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com