Simple suggestion - change the default filter to “only consumables” (arrows and similar) if the player’s inventory contains too many items. If we ever get a “favourite items” system, filter to only those instead.
Obviously make it clear that a filter has been applied, so players don’t just discover their inventory has vanished and think their data was deleted.
Applies to inventories, trade menu, etc. No more lag spikes.