The :hoplon: ClojureScript Web Framework - http://hoplon.io/
candera 2018-03-01T12:47:12.000302Z

OK, so I have more information on the situation that makes when-dom eat CPU. I don’t think it’s specific to my application. I believe it happens when using Hoplon jquery. In jquery.cljs, there’s a default on! handler that attaches the callback. But I believe I have a situation where items are added to the DOM and then taken out (into the tpl cache, I believe) before the event loop starts properly. So the condition inside when-dom is never satisfied, or is not satisfied until much later, and CPU chompage results.

candera 2018-03-01T12:47:29.000189Z

What’s weird is that I can rewrite when-dom to give up after a while and my app still works just fine…




good sleuthing


@candera are you using standard tpl implementation or your custom one?

candera 2018-03-01T15:32:17.000242Z

Both, and I haven’t tracked down which one it is.


hopefully not mine 😉


if it's me i apologise

candera 2018-03-01T15:55:36.000096Z

No, I’m not using yours yet.

candera 2018-03-01T15:55:43.000638Z

I have started to move mine in that direction, though.


you'll need latest hoplon to use mine, the updates to merge-kids are needed

candera 2018-03-01T16:11:26.000508Z

Yeah, that’s why I haven’t moved.


soz, it is simpler though

candera 2018-03-01T16:35:53.000576Z

Right, and I took some of your good ideas. 🙂

candera 2018-03-01T18:36:35.000636Z

So, there’s an interesting technique where you can use CSS animations to get notified of an element being added to the DOM:

candera 2018-03-01T18:36:45.000658Z


candera 2018-03-01T18:38:06.000481Z

I might wind up trying that. Will let you know how it goes.