4 ms·
I had written a program a while back that needed to load all of the customers outgoing emails from multiple large .pst files. I got a pretty big performance ga
by skate22 8y ago
I had written a program a while back that needed to load all of the customers outgoing emails from multiple large .pst files. I got a pretty big performance gain using a thread pool to do the io for all the files concurrently and block until they all finished with thread join() calls. (As opposed to loading them 1 after another)
The actual runtime difference for me was 40 mins -> 10 mins
- kccqzy 8y agoThat's not really relevant. Both the article and the comment is talking about single-threaded I/O.
- gpderetta 8y agoIt is very relevant. Both async io and multithreaded io are ways to extract parallelism. Which one is more appropriate depends on the characteristics of the problem.
- skate22 8y agoYou may have missed the "multi threaded vs single threaded" section where they talk about a very similar pattern: "The way it works is simple, it uses blocking IO, but each blocking call is made in its own thread. Now depending on the implementation, it either takes a callback, or uses a polling model, like returning a Future."