Europe Pub
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS Bot@lemmy.bestiver.seBM to Lobste.rs@lemmy.bestiver.seEnglish · 2 days ago

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

ertu.dev

external-link
message-square
0
link
fedilink
  • cross-posted to:
  • clojure@programming.dev
8
external-link

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

ertu.dev

RSS Bot@lemmy.bestiver.seBM to Lobste.rs@lemmy.bestiver.seEnglish · 2 days ago
message-square
0
link
fedilink
  • cross-posted to:
  • clojure@programming.dev
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.

Comments

alert-triangle
You must log in or # to comment.

Lobste.rs@lemmy.bestiver.se

lobsters@lemmy.bestiver.se

Subscribe from Remote Instance

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: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Source of the RSS Bot

Visibility: Public
globe

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

  • 24 users / day
  • 182 users / week
  • 451 users / month
  • 1.69K users / 6 months
  • 2 local subscribers
  • 382 subscribers
  • 9.23K Posts
  • 732 Comments
  • Modlog
  • mods:
  • patrick@lemmy.bestiver.se
  • RSS Bot@lemmy.bestiver.seB
  • BE: 0.19.18
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org