I tried your mod coz I was interested in having auto-crafting machines as needed, using crafting combinator.
I noticed a constant huge lag spike and, was not that surprised taking into account the size of my logistic network. I also noticed that I already have 1.1k cells and, I am not even on blue science yet! (Py suite...) Imagine the lag spikes later on....
So, I looked into you code to see if there was something that could be done and I notice that, for each cell, you take the boundaries and do the scan in that boundary. That is fine and makes sense on a "normal" network. But... if you have a lot of overlapping cells, it is a big waste if time. In my case, you are scanning 8 times the same zone (using a city block layout).....
It occurred to me that you could have an alternate scan mode (enabled/disabled through the options), call it basic mode, that works pretty well in city block style factories. Since in these layouts the factory is a big square instead of organic growing cells, would make more sense to first scan all cells to get the boundaries of the whole network and then, with the boundary of the network do ONE scan for each thing you need to find instead of thousands of scans per cells.
Yes, there is a chance of some random cell making the boundary bigger then needed and then you are scanning "empty" areas and reporting wrong data but the chance of this happening in city-block layouts is minimal.
Hey... call it a downside of basic scan mode!
I thinks this new scan mode its an easy implementation and would improve drastically the UPS, specially on big bases like Pyanodons bases!"