News for hackers. Stuff that matters.
Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @01:20PM (#30314925)
> … aren’t allowed to preallocate memory…

Because as-you-know the whole point is to "allocate zillions of short-lived nodes" —

https://news.ycombinator.com/item?id=29323468

Re:Sustainability with Rust by sirwhinesalot on Saturday February 12, 2022 @04:55PM (#30316918)
The C++ and Swift implementations use a node pool from the Apache Portable Runtime. This benchmark would be a lot more interesting if we got to see the price of C++'s RAII or Swift's reference counting.

The Swift Code looks like something you'd write in C.

Re:Sustainability with Rust by igouy on Sunday February 13, 2022 @04:37PM (#30325932)
> … the price of C++'s RAII…

Like this? (There are 8 other C++ binary trees programs.)

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

> … or Swift's reference counting.

Like this? (There are 4 other Swift binary trees programs.)

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @08:11PM (#30318084)
You could ask the authors to update their study.

You could look at the different binary trees programs shown on the current benchmarks game.

Re:Sustainability with Rust by throwaway894345 on Saturday February 12, 2022 @02:14PM (#30315413)
“It’s not a bad benchmark, it’s just showcasing a contrived scenario with different sets of rules for different kinds of languages”.

Most people aren't building applications whose business requirements preclude preallocating memory except for languages which lack garbage collectors.

Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @02:27PM (#30315516)
So those are scare quotes not actually quotation?

If we don't experience a performance problem, we don't need a workaround.

Re:Sustainability with Rust by throwaway894345 on Saturday February 12, 2022 @03:41PM (#30316185)
No, that’s not an actual quotation. I was having a laugh at the silly logic which attempts to justify the benchmark. And preallocating isn’t a workaround, it’s idiomatic in Go.
Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @04:27PM (#30316681)
That is not a contradiction: it can be both idiomatic in Go and a workaround to avoid garbage collection.
Re:Sustainability with Rust by throwaway894345 on Saturday February 12, 2022 @04:53PM (#30316904)
And that’s a valid point for the set of applications whose purpose is generating garbage. But overwhelmingly this isn’t interesting and people mistake this benchmark for a useful indicator of programming language performance in the general case.
Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @06:21PM (#30317378)
And the set of applications that will inevitably generate garbage, which might be left to automatic garbage collection.

Errare humanum est.

"Energy Efficiency across Programming Languages" not "programming language performance in the general case".

Re:Sustainability with Rust by throwaway894345 on Saturday February 12, 2022 @07:08PM (#30317685)
It’s not a very compelling defense of a benchmark to argue that it measures something different for some languages than others—in this case for Go the benchmark measures poorly/carelessly written code while for other languages it measures meticulously optimized code.

I maintain a contrived benchmark is not a useful benchmark.

Re:Sustainability with Rust by igouy on Saturday February 12, 2022 @08:20PM (#30318158)
In this case for Go, the same as other languages that provide automatic garbage collection.

In this case for Go, the same as other languages that provide a library pool implementation.

Apparently the study authors found a use.