Skip to content
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

massive tick lag when using multiple item interfaces on chests #286

Closed
judos opened this issue Feb 27, 2024 · 11 comments
Closed

massive tick lag when using multiple item interfaces on chests #286

judos opened this issue Feb 27, 2024 · 11 comments

Comments

@judos
Copy link

judos commented Feb 27, 2024

Issue type:

  • 🐌 Performance issue

Short description:

I placed 8 additional chests with item interfaces to extend my storage network, then I noticed massive tick lag.
When I remove the item interfaces the lag is gone again.

Steps to reproduce the problem:

  1. start up dw20 mc1.20 version 1.12.1
  2. setup network with 8 chests
  3. add many hundreds of items
  4. add item interfaces to chests and several exporter/ importer
  5. lag

This is what we have on a server basically.
Testing on SP didn't seem so easy to reproduce. Is there performence issue when certain items are in the system?

I will try to get a server profiling report with spark in the following days. Need to ask admin first


Versions:

  • This mod: 1.20.1-1.8.24
  • Minecraft: 1.20.1
  • Forge: 47.1.84 (Neoforge)

Profiler output:

Client side reports:

2024-02-27_23_23_29-Picard-1_20_1 without chest interfaces.zip

2024-02-27_23_26_26-Picard-1_20_1 without chest interfaces.zip
2024-02-27_23 18 15
2024-02-27_23 18 27

@rubensworks
Copy link
Member

Thanks for reporting!

@rubensworks
Copy link
Member

I will try to get a server profiling report with spark in the following days. Need to ask admin first

That would be great! :-)
Putting this issue on hold until then.

@judos
Copy link
Author

judos commented Feb 28, 2024

Ok managed to check it:
wZGSnDsXqD.zip

The cause is definitely from IntegratedTunnels:
image

Inside the IntegratedTunnels part there is a lambda which causes some issues here:
image

We have setup a testing server where the savegame with issues is on. If you have any more questions about Blocks or Items we have at certain positions I can go check that out.

Thanks for looking at it.

@rubensworks
Copy link
Member

@judos Do you have a URL to the spark log?

@judos
Copy link
Author

judos commented Mar 1, 2024

@rubensworks no, the url from spark didn't work, but we exported the data (see above zip file) this one you can drag & drop onto the field at https://spark.lucko.me/
That gave me the data as in the screenshot. Is that enough? Or is there something missing in that?

If necessary we could restart the testing server and keep the profiling running, while it is live the spark url worked I think.

spark is a performance profiler for Minecraft clients, servers, and proxies.

@rubensworks
Copy link
Member

Aha, TIL that spark works like that :-)

@judos It looks like you have some kind of expensive export operation that is not able to exploit the indexes of the network. Could you let me know which exporters you have programmed on that network? (you could also check the ID network diagnostics to see which exporters are the most expensive TPS-wise)

Note to self:
Screenshot 2024-03-03 at 17 03 34

@judos
Copy link
Author

judos commented Mar 4, 2024

Hmm I have many exporters on that network. How exactly do I check the ID network diagnostics to see which one is expensive?
The exporters are mainly just exporting certain items or a short list of items, as I'm relatively new to the mod.

@rubensworks
Copy link
Member

\integrateddynamics networkdiagnostics

@judos
Copy link
Author

judos commented Mar 27, 2024

That's a cool diagnostics you got there :)
The component doesn't look special to me. Item Exporter exporting Wax + Charcoal into an already full Iron Chest.

image
2024-03-27_21 03 18
2024-03-27_21 04 01
2024-03-27_21 04 52

image

@judos
Copy link
Author

judos commented Mar 27, 2024

Changed the chest to a normal vanilla Wooden Chest. Still changes between 7ms and 15ms just to export items into a full chest.

Does that help you to reproduce the issue?

Further settings:
Channel 0
round-robin: False
blacklist: False
Transfer rate 64
Item Slot -1
Passive interaction: True
Check Stack Size: False
Check NBT: False

Changing to only fill into Slot 0 reduces time usage significantly. But this shouldn't be a requirement.

Changing to a Variable Card with only Item Charcoal or Item Wax uses 0.04ms.
So something in the code when using a Type List with multiple Items is causing issues.

@rubensworks
Copy link
Member

rubensworks commented Apr 8, 2024

Note to self:

Problem is that IngredientPredicateItemStackList can not make use of matchflags-based indexes.
Let's extend IngredientPredicate so that it accepts a disjunctive list of ingredients on which matchflags can be applied.
Then we'll have to do some looping in the ingredient movement logic.
Change in 1.18 and above.

rubensworks added a commit that referenced this issue Apr 23, 2024
This makes importers and exporters configured with
a list aspect make better use of internal indexes
to significantly reduce server load.

Closes #286
@rubensworks rubensworks moved this to Done in Maintenance Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants