The Optimizations in Erlang/OTP 27
erlang.org
erlang.org
[1] https://zeroclarkthirty.com/2024-04-21-benchmarking-erlangs-...
I'm legitimately surprised with their performance achievements there.
What's the logic behind this?
> Running an unpatched Erlang/OTP 26 on my Intel-based iMac from 2017, the benchmark finishes in about 10 seconds.
> The same benchmark run using Erlang/OTP 26.0.2 finishes in about 0.4 seconds.
I love that Erlang even supports an integer with 1,262,000 digits, but I imagine that's one reason it'll never be a mathematical speed daemon.
And Erlang/OTP follows a pattern of not setting limits on things unless needed, but not necessarily being well optimized at large sizes. Big integers have been there forever? with no explicit size limit, but pretty slow for the last several decades.
Yep, SBCL does range analysis and can do inline fixnum or unboxed arithmetic.
Using Karatsuba fixes a problem I've been complaining about for awhile when I'd run into certain fake-believe leetcode style problem or just doing weird non-sensical math benchmarks across different languages.
If you're not familiar with Karatsuba checkout the following
But a million digits is a pretty good BigInteger. What is that? Half a megabyte?
Somewhere in our half million line (I actually don’t know, because we didn’t have a monorepo) application someone turned a stat into a string and I never did track it down.
When we migrated from StatsD that became a problem.
>> A brief history of recent optimizations
>> Erlang/OTP 22 introduced a new SSA-based intermediate representation in the compiler.