【Hacker News搬运】Erlang/OTP 27中的优化
-
Title: The Optimizations in Erlang/OTP 27
Erlang/OTP 27中的优化
Text:
Url: https://www.erlang.org/blog/optimizations/
文章探讨了Erlang/OTP 27中的新优化,包括记录更新的优化和其他改进。文章还简要回顾了导致Erlang/OTP 27的最近优化历史。 最近Erlang优化的现代历史始于2018年1月。我们意识到,在Erlang编译器的BEAM代码上进行优化已经达到了极限。 - Erlang/OTP 22在编译器中引入了一种新的基于SSA的中间表示。 - Erlang/OTP 24引入了JIT(即时编译器),通过在加载时为BEAM指令生成本地代码来提高性能。 - Erlang/OTP 25在JIT中引入了基于类型的优化,允许Erlang编译器将类型信息传递给JIT,以帮助它生成更好的本地代码。 - Erlang/OTP 26改进了基于类型的优化。最显著的性能改进是在使用位符号匹配和二进制构造时的匹配和构建。 Erlang/OTP 27的主要编译器和JIT改进是对记录操作的优化,但也有许多其他较小的优化,使代码更小或更快。 文章还介绍了一些示例,包括简单的记录优化、就地更新记录、通过生成更少垃圾来优化、funs的优化以及整数算术的改进。此外,还提到了许多对许多指令的代码生成进行了增强,以及对Erlang编译器进行的一些改进。 总的来说,文章详细介绍了Erlang/OTP 27中的各种优化,旨在提高性能和效率。
Post by: pjmlp
Comments:
asa400: This is not mentioned in the article, but since it has performance implications for a ton of BEAM applications, it's probably relevant: OTP 27 will also include a new builtin JSON module, and I did a quick and dirty benchmark [1] of it against Elixir's (excellent) Jason library. It seems like it'll be a pretty good performance win for BEAM applications that work with JSON.<p>[1] <a href="https://zeroclarkthirty.com/2024-04-21-benchmarking-erlangs-new-json" rel="nofollow">https://zeroclarkthirty.com/2024-04-21-benchmarking-erlangs-...</a>
asa400: 这在文章中没有提及,但由于它对大量BEAM应用程序具有性能影响;s可能相关:OTP 27还将包括一个新的内置JSON模块,我针对Elixir;s(优秀的)杰森图书馆。看起来它;对于使用JSON的BEAM应用程序来说,这将是一个相当好的性能胜利<p> [1]<a href=“https://;/;zeroclarkthirty.com�-04-21-bnchmarking-elangs-news-json”rel=“nofollow”>https:///;zeroclarkthirty.com/;2024-04-21-德国柏林-</一
macintux: > ...It measures the time to convert a binary holding 1,262,000 digits to an integer.<p>> Running an unpatched Erlang/OTP 26 on my Intel-based iMac from 2017, the benchmark finishes in about 10 seconds.<p>> The same benchmark run using Erlang/OTP 26.0.2 finishes in about 0.4 seconds.<p>I love that Erlang even <i>supports</i> an integer with 1,262,000 digits, but I imagine that's one reason it'll never be a mathematical speed daemon.
macintux: >。。。它测量将包含1262000位数字的二进制转换为整数的时间<p> >;运行未修补的Erlang/;2017年,我在基于英特尔的iMac上安装了OTP 26,基准测试大约在10秒内完成<p> >;使用Erlang;OTP 26.0.2在大约0.4秒内完成<p> 我喜欢Erlang甚至<I>支持</I>具有1262000个数字的整数,但我认为;这是它的一个原因;我永远不会成为一个数学速度守护进程。
alberth: Seems like most of the optimizations were actually in 26.0.2 (not 27).
alberth: 看起来大多数优化实际上是在26.0.2(而不是27)。
lamuswawir: If no more optimisations could be done in OTP 22, does that mean 22 is completed software.
lamuswawir: 如果不能在OTP 22中进行更多的优化,这是否意味着22是完整的软件。