Iskallia / Vault-public-S1

👾 (Legacy) A mod that adds the mystic vaults for Vault Hunters modpack. (Public port of the Livestream version)
GNU General Public License v3.0
84 stars 40 forks source link

Simple Storage Network framerate drop when searching item descriptions #1219

Open ChrisLane opened 1 year ago

ChrisLane commented 1 year ago

Describe the bug When searching my Simple Storage Network for descriptions on vault items, the game does a lot of processing and my framerate drops.

For example, when I search for "#shovelling" to look for shovelling jewels, the framrate drops.

To Reproduce

  1. Put lots of items in a Simple Storage Network, including lots of vault items and Jewels
  2. Search for a description term that appears in vault items e.g. "#shovelling"

Expected behavior The framerate should not drop when searching vault item descriptions.

Screenshots or Crash Report Here's a snapshot I got while using a CPU profiler. It looks like a significant portion of CPU time is spent compiling regex patterns. If possible, this should just be done once.

image

Here's a snapshot exported from VisualVM: slow-search-snapshot.nps.zip

Info (please complete the following information):

Additional context This doesn't happen when searching items that are not from 'The Vault'.