Refined Storage

Refined Storage

77M Downloads

[1.10.2][FeatureRequest] add a updateFrequency config to external Storage

Speiger opened this issue ยท 15 comments

commented

RS Storage Busses are nice. Sadly with drawers and other big inventories they are actually a big lag source.
I understand that these have to be updated freqently.
But our server is a weak one that cant handle much and a Single Storage Bus can take 20% (2.184MS) of the lag alone which is not nice.
I dont want to get rid of That mod because i find it better the AE.

So my request is to add a config that reduces the refreshrate optionally to every second or a certain amount of things. Because Iterating through a lets say 40-80 4x Slots Storage drawer with multistacks is actually really slow...

I know minecraft isnt a source of stuff to do a good and relyable. But options like these for small servers would really help.

Thanks for reading.

commented
commented

For any connected storage, RS rechecks every few ticks or so.

Now for drawers, this shouldn't give any lag at all. Since it only has to scan 1 inventory slot.

It would give lag for big item handlers (big chests), are any of those connected? I'm not convinced this is caused by drawers.

commented
commented

@raoulvdberge sry for my typo in the drawer department. But i though you would understand 40-60Drawer 4x Drawer. As i meant drawerControllers or drawer slaves

So what i speak of is drawer controler. And no drawers get updated every single tick.
I saw that in your code.
Code that gets called per tick. (Its the ITickableUpdate)
https://github.com/raoulvdberge/refinedstorage/blob/mc1.10/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/TileExternalStorage.java#L138

The Compare Function that iterates through every Slot. compares items.
https://github.com/raoulvdberge/refinedstorage/blob/mc1.10/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/ItemStorageExternal.java#L16

The function that gets all items.
https://github.com/raoulvdberge/refinedstorage/blob/mc1.10/src/main/java/com/raoulvdberge/refinedstorage/tile/externalstorage/ItemStorageDrawerGroup.java#L25

So you iterate through all drawers once and then through all stacks that got added per tick.
Then comes compare logic. And other things into play.
So for a external storage thats really really laggy.

@way2muchnoise i dont use the Profiler you have.
I used TickProfiler.
This result was made over 13minutes of profiling. And it was printed like 1 minute ago.

[09:53:10] [TickProfiler/INFO] [TickProfiler]:
TPS: 19.97598
                                  Single Entity | Time/Tick |      %
            TileExternalStorage {256,78,1222}:0 |     2.435 | 14.933
            TileExternalStorage {784,39,1657}:0 |     0.733 |  4.495
            tile.TileController {1088,86,848}:0 |     0.280 |  1.716
TileMultipartContainer$Ticking {-267,129,815}:0 |     0.275 |  1.687
            TileExternalStorage {255,82,1226}:0 |     0.243 |  1.490
     Chunk | Time/Tick |      %
 0: 16, 76 |     2.547 | 15.617
 0: -6, 19 |     1.303 |  7.991
0: 49, 103 |     1.137 |  6.974
0: -24, 19 |     0.987 |  6.051
 0: 69, 53 |     0.879 |  5.390
     All Entities of Type | Time/Tick |      %
      TileExternalStorage |     3.960 | 24.285
       TileTransferHolder |     2.644 | 16.214
      passive.EntitySheep |     1.076 |  6.601
   passive.EntityVillager |     0.655 |  4.018
TileEntityElectricFurnace |     0.609 |  3.735
    Average Entity of Type | Time/tick |  Calls
       TileExternalStorage |     0.172 | 459448
       tile.TileController |     0.154 |  59928
           item.EntityBoat |     0.136 |  19976
manipulator.TileItemLoader |     0.098 |  19976
        TileEngineElectric |     0.071 |  99880

As you can see your stuff is at the first place of time. (Those External Storages are only bound to drawercontrollers)
The only thing close behind are Extra utils nodes. These are laggy as shit by default but those get removed really soon...
So i ask you again: Would you add a config to make the "External Storage" Refresh rate optionally slower for server who dont have much capacity?

commented

@BrianEdmonds
Storage Drawers updates its stuff every 5 seconds thats not the problem.
The problem is that RS checks the drawer its connected to every tick. To find changes and update quickly.
I can to 5% understand why that is the case but the 95% of me say: Why is it every tick? It could be every 20 ticks or if a really hard request like a crafting option or something like that then do it instantly to validate required items. But other then that it should not update every tick for every controller/slave it is connected to.
Because the getting the items then comparing them etc is a really really slow thing. Its not like this takes like a couple nano seconds. No that takes milliseconds. And we have only 50 of those per tick. So placing down 1 controller that takes 2 of those and we have 5 people that have 1 then we have already 10ms just for comparing stacks. And our default MS right now on our server is without people online 30ms.
And RS is on the first place of things. Followed by Extra Utils 2 which turns out to be the most shitty mod i have ever seen.

commented

TickProfiler isn't accurate enough for us as we don't see what methods are problematic.

Also, how many drawers are connected? One compare operation * a few drawers per tick shouldn't give any problems at all.

commented

We talk here about 40-60 4x Drawers with stackUpgrade.

Also why is tickprofiler not accurate for you?
And stop starting to get ecuses in. Thats a excuse. The effect on that one is maybe 0.001ms or 0.01ms at worst per tileEntity But that is equally shared. And you have 2.435ms that means it would bei either 2.434ms or 2.425ms the point is your thing is slow.
If that is unaccurate for you then go ahead come to our server and test it yourself.

commented

It could be that some other code is slower that is called from the TE which tickprofiler doesn't tell you.

commented

@way2muchnoise i check the code of the TickProfiler.
It is a small haugh like every other profiler but i know what i am dealing with.
Unlike Players stuff which is closed stuff most of the time. Unless you can give me the sourcecode of it i wont use it.

commented

I am not coming with excuses, I'm just thinking in a rational way about the performance impact of a few comparisons per tick.

When talking about accuracy I'm not talking about the accuracy of the TPS, I am talking about the accuracy of the information. A NPS file gives us more information (it adds the methods that are slow) than TickProfiler, thus, a NPS file is more accurate.

commented

ok i just removed rs and we went from 20-30 ms down to a 10-20ms...
Just removing RS saved us 10MS

commented

so its doing a StackTrace in terms of Issues.
ok whats the difference between a stacktrace and a person telling you a stacktrace of a issue...
Anyway i see that this runs into nothing. Thanks for no support.

commented

Listen. I did not tell I'm not giving you any support. What I DID say is that I want a NPS file before I can give you support. I need a trace to the exact method that is problematic, and NPS files gives those. "Just saying" is useless to me as a programmer and you know it.

Now, don't test my patience or you won't get any support.

commented

@raoulvdberge what i requested was simple. I just put a issue in front of that to give you a reason.
If you dont want to add this config then the patients of yours is wasted.
I requested a config to reduce the refreshrate of RS Storage Busses. Because they cause lag. That would reduce lag. If you dont want to do that then its fine i have to deal with that.
I either remove RS completly or just disable storage busses. Its as simple as that.

So i await your answer.

commented

Okay, if you're not planning to send me any performance files so I can fix the issue instead of working around it with configs, I'm done.