This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-15
Channels
- # announcements (8)
- # architecture (9)
- # autochrome-github (1)
- # babashka (48)
- # beginners (55)
- # calva (36)
- # cider (16)
- # clj-commons (1)
- # clj-kondo (38)
- # cljs-dev (44)
- # cljsrn (1)
- # clojure (164)
- # clojure-europe (35)
- # clojure-nl (2)
- # clojure-norway (10)
- # clojure-uk (23)
- # clojurescript (50)
- # conjure (24)
- # core-async (1)
- # cryogen (2)
- # cursive (38)
- # datalevin (11)
- # datascript (2)
- # datomic (13)
- # duct (1)
- # emacs (16)
- # events (12)
- # exercism (3)
- # figwheel-main (7)
- # fulcro (26)
- # honeysql (5)
- # integrant (1)
- # jobs (3)
- # kaocha (6)
- # lsp (72)
- # malli (22)
- # nextjournal (35)
- # nrepl (1)
- # off-topic (34)
- # pathom (5)
- # polylith (8)
- # portal (40)
- # re-frame (14)
- # reagent (42)
- # reitit (1)
- # releases (1)
- # remote-jobs (1)
- # reveal (9)
- # sci (2)
- # shadow-cljs (13)
- # sql (3)
- # tools-deps (33)
- # vim (25)
Mornin;
@UK0810AQ2 You've asked for some flamegraphs...
The rendered itself was quite respectable, taking 2-3 seconds to render a 640x480 scene, but actually converting the result to a PPM file (using a StringBuilder) was another 8-9 seconds.
After taking care of that, rendering now dominates - but a significant chunk of that was actually setting a pixel in the canvas array, because I was using the high-level set-selection!
of core.matrix.
Replacing that with just setting 3 r g b values pushes that down even further. Now I see two instance of sort-by taking a long time to sort just a handful of hits so that's the next place to optimise. Everything else seems to bottom out more or less to the matrix operations. Perhaps allocating points/vectors could be faster as that happens a lot. Perhaps using a macro or something would make sense.
you can zoom in on each of the stacks. Maybe if you do it without mapcat you'll gain a huge speedup
I'd like som context, @U7PBP4UVA! 😃
It's nice to coding to a spec. The book gives you some test cases, then guides on you on how to implement the algorithms. It's actually quite relaxing.
I was sure core matrix was already under org.clojure. Did you model the tuple as array?
Yes, an array of 4 elements. Makes sense for all the following matrix multiplications. The book actually gives you guidance for all of this.
!måning
Morning! No snow here too, it's more a family trip to the sea in Normandy France 👋
I took this yesterday. It is a bit windier today https://photos.app.goo.gl/V6W2axhg2vvfqYRAA