编程语言与软件工程2024onlinelibrary.wiley.com
每秒解析数百万个 URL(2023)
Parsing millions of URLs per Second (2023)
进阶 · 约 60 分钟读完前置知识:URL 规范化与 punycode 基础、C/C++ 性能优化、Node.js/V8 基础
导读
这篇论文介绍了一个每秒可解析数百万条 URL 的高性能解析器,并讨论了 URL 解析与规范化(如 punycode 转换、路径归一化)的实现细节。作者还将其方案集成到 Node.js 中并给出了性能基准对比。
HN 关注点:其极致性能优化的技术细节,同时也质疑论文基准测试的严谨性,以及该解析器是否存在过度营销的嫌疑。
HN 评论精选
这几条评论里:质疑 3 补充 1
质疑指出论文示例中 http 被改成 https 的疑似错误
论文示例称输入 http://你好你好.在线/./a/../b/./c 应规范化为 https://xn–6qqa088eba.xn–3ds/b/c——为什么规范化会把 http:// 改成 https://?
Thorrez查看英文原文
> For example, the input string http://你好你好.在线/./a/../b/./c should be normalized to the string https://xn–6qqa088eba.xn–3ds/b/c Why would normalization change http:// to https:// ?
质疑质疑该解析器存在过度营销,并附上 curl 作者的对比分析链接
我很好奇他们花在推广这个解析器上的时间是否比写它的时间还多?我见过不少关于它的垃圾宣传,不止我一个人这么觉得。并引用了 daniel.haxx.se 关于 URL 解析器性能的博客。
grayhatter查看英文原文
I wonder how much time was spent promoting this parser, vs time spent on writing it? I've seen a lot of spam for this one, and I'm not the only one. https://daniel.haxx.se/blog/2023/11/21/url-parser-performance/
质疑质疑 Node 版本对比基准受 V8 版本混淆,建议在同一 Node 版本上打补丁对比
这种工作我做不出来,但论文至少有一个潜在问题:基准测试对比不同 Node 版本,能否得出真实世界的性能提升?一个可能的混淆因素是 V8 引擎版本也在变化(Node 18 和 20 用的 V8 版本不同)。理想情况下,他们应该把改动直接打进 Node 18.15,用补丁版和原版 18.15 对比测试。
Cicero22查看英文原文
This sort of work is something I wouldn't be able to do, but I can't help but point out at least one potential issue with the paper. It's a lot easier to find problems than solutions I guess. Are the benchmarks comparing node versions valid to conclude a real world performance increase? one possible confounder is the version of V8. https://github.com/nodejs/node/blob/v18.x/deps/v8/include/v8-version.h https://github.com/nodejs/node/blob/v20.x/deps/v8/include/v8-version.h ideally, they would've patched Node 18.15 with their changes directly and test their patch against 18.15.
补充纠正 HN 标题与论文原标题不符
标题似乎漏了几个词,原标题是 'Parsing millions of URLs per second'。
notamy查看英文原文
The title seems to have a few words missing. Original title: > Parsing millions of URLs per second
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
- 代码
- github.com/nodejs/node被提到 2 次
- 评论区提到的论文
历次讨论
- 2024Hacker News 讨论帖157 分 · 39 评
同领域还值得读
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 分钟编辑精选