News for hackers. Stuff that matters.
Re:Idiomatic Clojure without sacrificing performance by reitzensteinm on Sunday October 24, 2021 @06:18AM (#28976520)
In my experience you can usually achieve near linear speed up. My machine can run 24 threads.
Re:Idiomatic Clojure without sacrificing performance by MillenialMan on Sunday October 24, 2021 @06:56AM (#28976696)
Fair enough on scaling. But 24 is still a lot less than two to three orders of magnitude.
Re:Idiomatic Clojure without sacrificing performance by reitzensteinm on Sunday October 24, 2021 @07:09AM (#28976784)
Yes, it is. I'd probably ballpark Clojure at 100x slower than the kinds of low level C# I usually write (gamedev). But threading C#, especially low level imperative C#, is so awful I often don't bother unless it's very important or there's an embarrassingly parallel element (genetic algorithms and simulating sound waves on a 2D grid are two cases I've pulled the trigger where both were true).

This leaves Clojure as 1/4 the overall speed, which seems about right. However that's based on a hugely unscientific gut feeling, because generally I don't touch Clojure if performance matters and I don't touch C# if it doesn't.

By the way, I've implemented persistent data structures on disk for a problem they were particularly useful for. If stalling for a cache miss feels bad, try waiting for an SSD :)

Re:Idiomatic Clojure without sacrificing performance by gpderetta on Sunday October 24, 2021 @07:50AM (#28977064)
Having to use 24 cores to get to 1/4th of the performance of a single threaded C# application seems particularly awful.

Especially as C# is a relatively pleasant language to use.

It doesn't matter how good threading in clojure is if you don't even need to use it to beat clojure on another language (also: great scaling is pointless if you start so far behind).

Re:Idiomatic Clojure without sacrificing performance by reitzensteinm on Sunday October 24, 2021 @08:09AM (#28977168)
Yes, hammering in a nail with a screwdriver is particularly awful. I love using Clojure where it's appropriate, but I'm not in the least bit tempted to use it for game dev.
Re:Idiomatic Clojure without sacrificing performance by gnuvince on Sunday October 24, 2021 @06:59AM (#28976710)
Could you share an example program that does that?