-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spread out slot transfer actions & caching #2900
base: 1.18
Are you sure you want to change the base?
Conversation
and Cache SidedStorage
RebornCore/src/main/java/reborncore/common/blockentity/SlotConfiguration.java
Outdated
Show resolved
Hide resolved
sorry, now I'm using Chrome
Small idea, but can we spread out packet sync timing by using |
....or wait until proper server-client code separation
Do we really need to update display that often tho? there might be better fix for this
@@ -117,7 +126,8 @@ public boolean isMultiblockValid() { | |||
public void writeMultiblock(MultiblockWriter writer) {} | |||
|
|||
public void syncWithAll() { | |||
if (world == null || world.isClient) { return; } | |||
if (world == null || world.isClient|| tickTime < lastTickedSync + 20) { return; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is casuing this to sync so much?
If its beign called everytick or something that should be sorted at the root of the issue imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its part of packet issue, mostly storage units, are being updated once altogether and causing packet bottleneck for certain players, generating packet 'spikes'... so this is not really the solution.
I found that block entities are having same interval and same starting point, which was not spreading out packets over time(also mspt too).
"Spreading out" doesn't make sense imo, it still uses the same amount of time in total.
Why? Is it just caching the storages? I see 3 somewhat unrelated changes, you should only keep the one(s) that actually make(s) a difference. |
Actual difference came from spreading out its working timing, which was not ready for review. Storages or machines being loaded at once shared its working timing and intervals, it had bad performance and packet issue. Especially industrial chunk loader-loaded machines will share its timing, on world load.... I randomized its starting point and actual difference was made. Caching itself was very important too, however. Sync timing limit was not helpful at all, since storages were not spamming unlike machines, so I should revert it. |
I really don't see why spreading out work helps? It reduces tps variance, but shouldn't change mean tps? |
hmm yeah, I inspected more and found that 'instant input-output' is now disabled, not sure if its intended. Storage or general machines are having 2 ticks to handle items, instead of outputting instantly when its auto input + auto output. |
so are you saying we don't need this PR after all? |
I... would rather have these extreme cases deal with that themselves before we accidentically introduce bugs that affect 95% of the playerbase instead of the 5% it might be actually be made for. But that is just my POV |
I couldn't see any bugs or serious effects with this, as I'm already using it in my server... even before this, storage units were not instant dropper and its update order was not promising. So it shouldn't really affect something, except for some really extreme cases : Case A - someone was using 4-overclocked electric furnace as 'pipe', so they used input slot for Auto Input + Auto Output but still it requires review, to prevent any unknown bugs or issues.. should I separate PR, one with separate actions / one with caching inventories? |
!! It requires reviews
I was using this for months so it should be okay tho...
Changes :
Transfer Behavior : its transfer speed is actually equal, but it does not instantly transfers items.
-Now it inputs items then outputs items in separate tick, so it efficiently spreads out mspt.
Performance boosts:
Tested with 670 storage units working constantly, reduced 4.6mspt -> 2.67mspt