Has anyone done any profiling on which part of core.async contributes most to the load time?
It's not prohibitive, but it was enough that I refactored some code to use future
instead of thread
to avoid it.
What was your thread doing and how many did you create?
The delay happens at require time. Just adding the (:require...) clause to the ns declaration adds about a second of time.
I'm sure there's plenty of stuff in async that makes that delay reasonable (if it's needed). I was just wondering if anyone had looked into what causes the delay.
I think there’s a thread pool created on demand
It’s the macro stuff, has nothing to do with the threads
Ghadi actually has a speculative refactor that loads the go loop stuff on demand, avoiding the delay if you’re not using go’s but I’m not sure if that’s common enough to be worth the trouble
So is that considered a bug? Rich even said in his Inside Transducers + more.async talk that the backpressure semantics change with expanding transducers like cat, but the buffer size is still bounded. With the current behavior it can grow indefinitely.