Fork me on GitHub
#hoplon
<
2018-03-01
>
candera12:03:12

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.

candera12:03:29

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

thedavidmeister15:03:15

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

candera15:03:17

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

thedavidmeister15:03:31

hopefully not mine 😉

thedavidmeister15:03:40

if it's me i apologise

candera15:03:36

No, I’m not using yours yet.

candera15:03:43

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

thedavidmeister16:03:08

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

candera16:03:26

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

thedavidmeister16:03:06

soz, it is simpler though

candera16:03:53

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

candera18:03:35

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

candera18:03:06

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