Lag with Galv New Item Indication

I've noticed an odd lag that happens with Galv's New Item Indication. The more items you have in your inventory, especially during battle, the game chugs when you hover over them. After some time I realized what the problem was:

Ruby:
SceneManager.scene.refresh_new

class Scene_Base
  def refresh_new
    @item_window.refresh if @item_window
  end

It's this piece of code. From what I understand it's refreshing through every item to get rid of the "new" indicator immediately, and the more items there are the longer it takes.

I've rooted out that this is not a script conflict problem, as removing this little bit gets rid of the lag... but the "new" indications only vanish when you back out of the item window. This also happens in the fresh demo Galv himself provides that otherwise only has this script on it.

Is it possible to revamp the refresh method so it removes the new indicator from items individually instead of scanning through the entire item window?
I really can't see any lag.
How fast is your system?
I really can't see any lag.
How fast is your system?

I'm pretty sure it's not computer-related. The lag occurs when loading in all of the items in battle - a default new demo only has 30 items, so if you're not experiencing lag that's the reason. To see what I mean, copy-paste new battle items until you have 80+ or so, save and then run a battle test.

The lag should rocket up the more items you put in. If it still doesn't lag for you then I'll subscribe to the "my computer is slow" idea.

My projects tend to have a lot more than 30 items, so I saw it as a big issue.
I saw it as a big issue.
but that would also imply that the player would not open the menu until more than 80+ items have been obtained.
I imagine you have it on mode 2. Setting it to mode 1 would definitely fix that. Because it would be unlikely that a player would pick up 80+ new items before accessing the items. Either in battle or the menu.
But otherwise, yes you are probably right. The script would process every item and determine if it is new as compared to the last time it was viewed. this takes time to process.
The real question is after experiencing the lag and viewing the items, does it lag again the next time you access the items?
but that would also imply that the player would not open the menu until more than 80+ items have been obtained.
I imagine you have it on mode 2. Setting it to mode 1 would definitely fix that. Because it would be unlikely that a player would pick up 80+ new items before accessing the items. Either in battle or the menu.
But otherwise, yes you are probably right. The script would process every item and determine if it is new as compared to the last time it was viewed. this takes time to process.
The real question is after experiencing the lag and viewing the items, does it lag again the next time you access the items?

It was mode 1, unfortunately.

I tested it right now in a fresh demo with 70+ copies of hi-potion in separate slots and it still gave me the lag. Because here's the thing, I think the lag isn't really the "new indication" but is instead the amount of items the game has to render.

Since the item window is constantly refreshing, each new item slot slows it down more because it's going through each item in the menu for the sake of checking if the "new indicator" is removed... hence why I asked for a new method that only refreshes when you hover over the items themselves instead of scanning through the whole menu.

I took out the problem code and it still refreshes without the slowdown, albeit only when you leave that window and come back.
Just tested on an older project. (had to create 30 items)
Gave the player 85 items and accessed the menu without delay.
Tested on another demo. no delays.
Tested on Galv demo, no delays.
The only delay I saw was maybe my button pushing.

So I would think that you have some issue because you have scripts which access the features or notes on the items, and they are processing those notes while you scroll through the items.

Unless you want to give a test demo to diagnose I don't know what to do.

Original thread: https://forums.rpgmakerweb.com/threads/lag-with-galv-new-item-indication.144740/