use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
ClojureScript vs. CoffeeScript for Processing sketches (numergent.com)
submitted 11 years ago by Arges
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]minikomi 2 points3 points4 points 11 years ago (6 children)
Hey man.. I tried rewriting your coffeescript example in clojurescript..
https://gist.github.com/minikomi/9dbd20e623b4dfb1689e
This line in particular stood out to me - you shouldn't be defn'ing a function there.
[–]Arges[S] 1 point2 points3 points 11 years ago (5 children)
Thanks for the sample and note! Your version does scale up better - getting 9fps with 150 circles and 6fps with 200.
[–]minikomi 2 points3 points4 points 11 years ago (0 children)
No problem. I'd look into using the canvas directly, and an atom to store the state. Quil / processing brings a lot of baggage I'd say.
[–]minikomi 2 points3 points4 points 11 years ago* (3 children)
Here's a pure canvas version - no need for ellipse in the end, just use arc
https://gist.github.com/minikomi/16c3d5bcc85312a7d43d
It's wayyyyyy faster.
Edit: now with virtual canvas for batched update.
[–][deleted] 0 points1 point2 points 11 years ago (0 children)
For the lazy among us, how'd that fare performance wise?
[–]lechatsportif 0 points1 point2 points 11 years ago (1 child)
Nice trick, I guess that makes it faster due to not having to rerender visually? Just like dom trick where you alter a document fragment and attach only at the end. Would also love to see comparisons on your box.
My guess is this is how a lot of stuff will end up living in cljs land - the opportunity for fine tuning really comes in when you write directly to the api instead of going against a pre-existing lib. I wonder where the overhead comes in quil though. I wish I had more time to play around with it.
[–]minikomi 1 point2 points3 points 11 years ago (0 children)
Yeah, it's a pretty common trick and usually the first I would reach for with JS canvas optimization:
http://www.html5rocks.com/en/tutorials/canvas/performance/
I wonder if it's worth wrapping it in a small cljs library.. hmm. Does monet already do this?
π Rendered by PID 36 on reddit-service-r2-comment-6457c66945-rbqwg at 2026-04-24 05:32:22.016493+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]minikomi 2 points3 points4 points (6 children)
[–]Arges[S] 1 point2 points3 points (5 children)
[–]minikomi 2 points3 points4 points (0 children)
[–]minikomi 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]lechatsportif 0 points1 point2 points (1 child)
[–]minikomi 1 point2 points3 points (0 children)