Europe Pub
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002 to Clojure@programming.dev · 12 hours ago

Clojure is almost as fast as C (with some help)

ertu.dev

external-link
message-square
0
link
fedilink
  • cross-posted to:
  • lobsters@lemmy.bestiver.se
2
external-link

Clojure is almost as fast as C (with some help)

ertu.dev

cm0002 to Clojure@programming.dev · 12 hours ago
message-square
0
link
fedilink
  • cross-posted to:
  • lobsters@lemmy.bestiver.se
I have a stress test written in C: 100,000 cubes flying around in space. The CPU rebuilds every cube’s 4x4 transform matrix on every frame and sends all of them to the GPU. That is around 900,000 sine evaluations and 6 MB of matrix data per frame, and after that the GPU still has to draw 3.6 million triangles. So the frame is half CPU work, half GPU work. I ported it to Clojure and wanted to see how close I could get to the C version’s FPS. I should say up front that I did not do the optimization work alone: I paired with Claude Code on it, and most of the digging in this post (the benchmarks, the JIT logs, the failed attempts) comes from that session.
alert-triangle
You must log in or # to comment.

Clojure@programming.dev

clojure@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !clojure@programming.dev

Clojure is a dynamic, general-purpose programming language.

Resources:

  • Official Clojure(Script) Site
  • Clj Commons
  • Babashka
  • Toolbox
  • Clojurians Slack
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2 users / day
  • 4 users / week
  • 15 users / month
  • 44 users / 6 months
  • 2 local subscribers
  • 351 subscribers
  • 308 Posts
  • 13 Comments
  • Modlog
  • mods:
  • Ategon@programming.dev
  • ZehCnaS34@programming.dev
  • jeaye@programming.dev
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org