Fork me on GitHub
#clojurescript
<
2016-08-09
>
porglezomp02:08:35

Is there a good way to debug where the most garbage is getting made?

porglezomp02:08:06

I’m trying to write a game and I’m getting 60fps most of the time, and then when I get a GC pause it drops to 5fps.

porglezomp02:08:36

This would be acceptable occasionally but it’s happening very often.

danielcompton02:08:43

@porglezomp: have you tried jvisualvm or yourkit?

porglezomp02:08:27

For Javascript, not Java

porglezomp02:08:08

I figured out how to use the allocation tracker in Firefox, but I’m wondering if there’s anything Clojurescript specific

porglezomp02:08:51

I might have been a bit hasty asking here though, since the top 2 functions listed here are using 1/5 of all the memory allocated, and they’re both “warning/debug” functions inside react.

danielcompton02:08:59

but I don’t think there’s anything cljs specific

porglezomp02:08:41

I was reading that article. This is a new computer and I use firefox for my regular browsing, but it looks like I need to download chrome for the devtools. Thanks for the help!

borkdude09:08:49

This article appeared on my Twitter feed multiple times this morning. At first glance, it seems they make clojurescript harder than necessary? http://www.ibm.com/developerworks/cloud/library/cl-clojure-node-bluemix-app/index.html?ca=drs-

kauko09:08:35

It bothers me that he talks about clojure, but he's actually using clojurescript :f

asolovyov09:08:16

@thheller: shadow-build shows me quite a lot of warnings when I run find-resources-in-classpath - https://paste.in.ua/1866/ and more stuff like that

asolovyov09:08:20

@thheller: it also fails on compilation of https://github.com/r0man/sablono/blob/master/src/sablono/util.cljc#L3 with Invalid :refer, var clojure.set/rename-keys does not exist at line 1 sablono/util.cljc

martinklepsch10:08:46

Wow, that bluemix article is madness

thheller10:08:12

@asolovyov: yeah I need to relax the warnings when there is garbage on the classpath. unfortunately many libs package stuff that should never be in a jar 😞

thheller10:08:28

checking the :refer

porglezomp14:08:39

I’m trying to write externs for the first time, when packaging something that uses nodejs exports.foo = … how should I package it?

porglezomp15:08:04

Sorry, I meant while writing the externs file.

porglezomp15:08:43

I have a suspicion that this library isn’t written according to best practices, because every example I’ve seen is only referring to names in the source.

porglezomp15:08:06

and I presume I want to export that exports object, but I’m not sure the right way to do that.

porglezomp15:08:21

Since I don’t think I want to expose that as the API of the package I export.

porglezomp15:08:43

How can I package it so that something like tmx refers to that exports?

shader15:08:31

I keep getting an error java.lang.IllegalArgumentException: Namespace gateway.routes does not exist, even though that namespace/file exists and there is nothing wrong with it. Usually it seems to result from messing up some other ns elsewhere. Any ideas what could be causing that, and what I should do about it?

porglezomp15:08:09

Can anyone help me do namespacing in my externs?

nwjsmith15:08:10

@porglezomp: I'm not very familiar with externs, but you might be able to find what you're looking for by finding a node package in CLJSJS's packages: https://github.com/cljsjs/packages

porglezomp15:08:40

Yeah, I was looking at the nodejs buffer, but I can’t figure out how it actually works.

porglezomp15:08:13

Oh wait, the nodejs ones are out of tree there as well.

porglezomp16:08:58

For now I’m trying to use the library itself as the extern file, but the cljs extern packaging instructions isn’t working for me.

porglezomp16:08:58

I created deps.cljs in my src/ folder with the library under it, but I’m still getting

No such namespace: node-tmx-parser.core, could not locate node_tmx_parser/core.cljs, node_tmx_parser/core.cljc, or Closure namespace "node-tmx-parser.core”

atroche23:08:05

@shaunlebron: your API docs are awesome. thank you so much! http://cljs.github.io/api/