3 ms·
Why merge them at all? Can a lazy merge increase performance by the fact you are usually iterating over them and at that point most work will be done by the ite
by withinboredom 4y ago
Why merge them at all? Can a lazy merge increase performance by the fact you are usually iterating over them and at that point most work will be done by the iteration and not by the merger. That gives you some time to work out which thread/machine to pull from next while the main thread works on the result of the last iteration (ie, preempt the iteratie). You could even buffer/stream them from each thread much faster than any code could do real work.
In my experience, lock-free solutions tend to not do well when threads share a physical core (vs virtual cores), but ymmv.