Performance trouble with Processing jar

2014-03-29 Thread tamichan
Hi All I'm writing graphic clojure code with Processing jars. When I wrote heavy draw code, I found clojure code is slower than an equivalent of java. Probably, the cause is java method call. I call processing drawing method thousands times per one frame. (.line applet x1 y1 z1 x2 y2 z2) So

Re: Performance trouble with Processing jar

2014-03-29 Thread Adam Clements
Have you got type hints? If you do a java method call on something which isn't type hinted then clojure has to use reflection to look up a list of the available methods, which is slw. If however you tell it what type you expect it to be, it can better optimise it. So in the above code you

Re: Performance trouble with Processing jar

2014-03-29 Thread tamichan
Thanks Adam (def applet (new PApplet)) - (def ^PApplet (new PApplet)) results in amazing speed! And, quil certainly uses these type hints, sorry. In this trouble, I learned the principle of using type hints for much java method call. Ideally I wish clojure compiler may automatically add type