3 ms·
That javascript code is awful (and yet probably typical). There are three asynchronous readdirs that don't depend on each other (and should be able to run para
by ksherlock 12y ago
That javascript code is awful (and yet probably typical). There are three asynchronous readdirs that don't depend on each other (and should be able to run parallel) which now depend on each other and any asynchronous benefit is lost. Maybe haskell is smart enough to run them in parallel. For javascript, Promise.all would be better and avoid the pyramid of doom. Or, just use synchronous code for your, well, synchronous code.
- vampirebat 12y agoEvery monadic expression needs to be "run", and it turns out that with a different run function that exact code could be made to execute in parallel. In practice, though, you would probably use an explicit parallel combinator.