Advanced Peripherals

Advanced Peripherals

29M Downloads

The Rs bridge's listItems() method takes a long time to return anything

djmattyg007 opened this issue · 2 comments

commented

Descripe

I'm not exactly sure if this is a bug, but I'm not certain it's a feature request either. Basically it's a request for information around performance of the Rs bridge.

I undertook a brief review of the relevant code, and it seems as though it builds up a full list of data before returning any of it to the caller. I was wondering if this could be sped up at all by using an iterator to start returning values immediately. This would hopefully have a couple of beneficial impacts:

  • better performance for the caller, who can start performing operations sooner
  • better memory usage, as there's hopefully no longer a need to store the full list in memory all at once

As it stands right now, I'm concerned about the performance impact of calling this function on a regular basis for my game as a whole. It seems as though the game will freeze while waiting for the call to process.

Steps to reproduce

  1. Set up a refined storage network
  2. Store several thousand unique items in the network
  3. Connect a CC computer and an Rs bridge to the network
  4. Call listItems() on the Rs bridge peripheral, and observe that it takes over a second to start returning results

Multiplayer?

No

Version

1.16.5-0.7.7.1r (Latest 1.16)

Minecraft, Forge and maybe other related mods versions

Minecraft 1.16.5 Forge 36.2.26 CC: Tweaked 1.100.2 JEI 7.7.1.145

Screenshots or Videos

No response

Crashlog/log

No response

commented

Thank you for the report.

I'm not exactly sure if this is a bug, but I'm not certain it's a feature request either. Basically it's a request for information around performance of the Rs bridge.

Yeah, I'll count it now as performance-bug/issue

I'll see to fix this soon, not a big problem.
The storage system(ME and RS) needs a little refactor anyway.

commented

This issue is already open for a long time and I changed a lot regarding the rs bridge
It's hard for me to test the performance. I don't use RS and I can't create a big RS System

Would you mind to test this again with the latest version?