Project Red - Exploration

Project Red - Exploration

27M Downloads

Multiple requests lag the server to point of freezing

octylFractal opened this issue ยท 10 comments

commented

If crafting pipes are used, say, more than 1 per network, the request system eats up the entire server thread. It all falls down to OreDictionary.getOreId(), which takes up huge amounts of time.

Here's an image from my profiler that shows the method call trace:
image

Here's the rest of the trace (whoops):
image

commented

On a related note, #398 could be of interest

commented

Hmm, doesn't seem to be related to the problem here.

commented

I will see about switching to cached ore IDs.

commented

I wrote something to patch it; but I've been having trouble testing it due to the move to 1.7. If you want you can look at the changes I made in my patch-1 branch.

commented

Hmmmmm, While working on this patch I discovered the true cause of the issue: lostHandleTick() in RoutedCraftingPipePart. It seems to never exit.

commented

I'm so close to a fix on this; but every time I stick it on my server which first gave this report, it keeps happening.

commented

This fix relies on me knowing how this line is supposed to work:

unbalanced = unbalanced.filterNot(c => c.setsRequested > 0 && c.finalizeInteraction())

Is unbalanced supposed to retain (1) things with setsReq > 0 or (2) things with sets == 0 and (1) true for finalize or (2) false.

commented

basically, it is filtering (retaining) all the things "c" that do NOT pass the conditions.
So, after the line, unbalanced should not contain anything that has setsRequested > 0 and has finalized its operation.

commented

Also, what's the purpose of redoing the getMissingCount call before the final check?

Never mind, I see it recalculates from the added promises.

commented

I think there's a different issue that causes this, I'm closing this one in favor of the new one I'm opening.