Thanks. It takes some time for digest the tips. Didn't recognise partial is slow. I will refactor them with normal functions.
On Thursday, April 21, 2016 at 4:45:57 PM UTC+8, Thomas Heller wrote: > Hey, > > the .cirru code looks quite foreign but I guess I can kinda see what is going > on. cljs$core$next is probably not what is slow here, next when working on a > lazy seq will realize the next entry. So while next is fast the actual work > that happens is "slow". Flame Graphs are generally better for understanding > what is going on. > > Anyways, some general recommendations: > > - do not profile in dev mode. compile with :advanced mode. use :pseudo-names > true so you can still kinda see what code is running. At the very least > compile with :static-fns true. > - do not use partial. quamolit.alias has a bunch which I assume are called > frequently. > - do not use concat. Too lazy, too many allocations. > - try transducers as well, they allocate less. > > HTH, > /thomas > > > > > On Thursday, April 21, 2016 at 5:02:28 AM UTC+2, Jiyin Yiyong wrote: > > I got an app with ClojureScript and it's quite slow > > http://repo.tiye.me/Quamolit/quamolit/ > > > > My code is doing a lot of rendering work, I haven't yet finished designing > > the caching solution, but the CPU profile showed there's performance issue > > in `cljs$core$next`. Why is that slow, did I use it wrong? > > > > My code is at http://github.com/Quamolit/quamolit if you are interested run > > `boot compile-cirru` to get ClojureScript code, just another syntax... by > > running `boot dev` to start development environment. Since I used Hit > > Regions APIs, you need to turn on "Experimental Canvas features" to run the > > app, check here > > https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/addHitRegion -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/clojurescript.
