Re: core.async is very slow for some cases, what to do?

2014-03-13 Thread Jörg Winter
You could also try out: http://docs.paralleluniverse.co/pulsar/ Am Dienstag, 11. März 2014 18:39:54 UTC+1 schrieb Эльдар Габдуллин: Each go block is executed via thread pool. On a channel side, producers and consumers are also decoupled. Such decoupling costs around 10-20 us per async

Re: core.async is very slow for some cases, what to do?

2014-03-13 Thread Timothy Baldridge
Instead (! channel) (! channel val) you do (! (take! channel)) (! (put channel val)). That would make channels even slower, not to mention that it would probably completely break interaction with alts!. I'm not saying it absolutely couldn't be done, I just don't see a need for it. core.async is

Re: core.async is very slow for some cases, what to do?

2014-03-12 Thread Эльдар Габдуллин
My container benchmarks showed up to 3 times improvement after that hack. вторник, 11 марта 2014 г., 22:29:49 UTC+4 пользователь Ben Mabey написал: I've also ran into situations as well where the context switching of the thread pool is prohibitive. I swapped out the thread pool with a single

Re: core.async is very slow for some cases, what to do?

2014-03-12 Thread Эльдар Габдуллин
To be honest, I don't see any contradiction here. You can bring everything back easily: 1. Just take existing core.async channels as is 2. Replace callback based take! and put! with promise based take! and put! 3. That's it! Instead (! channel) (! channel val) you do (! (take!

core.async is very slow for some cases, what to do?

2014-03-11 Thread Эльдар Габдуллин
Each go block is executed via thread pool. On a channel side, producers and consumers are also decoupled. Such decoupling costs around 10-20 us per async operation. For the cases when your async values are immediately available (e.g. from cache), or when you designed an async API just because

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Ben Mabey
I've also ran into situations as well where the context switching of the thread pool is prohibitive. I swapped out the thread pool with a single threaded executor and saw a big speed improvement. The downside is that you can not specify what thread pool a go block should be ran on. This

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Timothy Baldridge
You can take the CSP out of core.async, but then it really isn't the same thing. Your version with promises still allows for async, but in the process removes most of the benefits of CSP. Timothy Baldridge On Tue, Mar 11, 2014 at 12:29 PM, Ben Mabey b...@benmabey.com wrote: I've also ran

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Ghadi Shayban
Comparing CSP and promises is apples-to-oranges. I'd love to see a minimal sample of problematic code. On Tuesday, March 11, 2014 1:39:54 PM UTC-4, Эльдар Габдуллин wrote: Each go block is executed via thread pool. On a channel side, producers and consumers are also decoupled. Such