3 ms·
I was about to suggest the same thing, and I still think it makes a lot of sense. However, the cache locality thing is complicated. Each bottle has data associ
by adrianmonk 2y ago
I was about to suggest the same thing, and I still think it makes a lot of sense.
However, the cache locality thing is complicated. Each bottle has data associated with it, but each processing stage might also have data. For example, maybe a particular stage uses a lookup table. Or maybe stages keep statistics as they process bottles.
If you have one CPU doing all the work for a particular stage, then per-stage data stays in its cache. But if you have one CPU doing all the work for a particular bottle, then all the per-bottle data stays in its cache. So there's a trade-off that depends on the specifics.
- kitd 2y agoMore importantly, each processing stage may have external resources it needs to manage to do its function. In many cases, it makes more sense to let the stage own the resource for all bottles, than to have a per-bottle process having to contend for the resource at the point it's needed.
- hinkley 2y agoYou get very different Little’s Law shapes from the too for sure. Who here hasn’t bought themselves some time from vertically or horizontally scaling a database by hoisting a bunch of calculations up and out of the transaction? Do them before or after the constraint. The farther you have to reach to coordinate use of the constraint the better it might be to hand the inputs to the constraint and let an experts handle things.