Performance testing related to charges issues
Describe the bug
I conducted the following tests: Comparing the situation where I have no items on me and there are no items around, I debug-generated 200,000 units of seasoning salt (the seasoning salt is innocent :( ) and dropped them on the ground, as well as stored them on my person. This was to simulate situations where items like sand become non-charged items (as we saw in the related PR that such items often exist in exaggerated quantities).
During the tests under both conditions, I encountered the following issues: When a single pocket on my character contains a large number of non-charged items, opening the inventory results in a significant delay, and the program may even become unresponsive. When moving, I experience noticeable lag and stuttering. The process of crafting items becomes significantly slower. When I open the menu to list nearby items, it takes several seconds to appear, and when I select an option that involves a large number of non-charged items, it also delays for several seconds.
Additionally, when these items become non-charged items, they are subject to the item limit restriction. If not placed in a container, it is easy to exceed the 4096 item limit. Yes, we can put them in bags, but this requires additional steps and does not solve the problem of an excessive number of non-charged items.
I must admit that I did not use a professional timer to calculate the exact duration of the lag, and I welcome anyone who can help provide more accurate timing.
Attach save file
Steps to reproduce
- Debug generates a lot of flavored salt or items without charges.
- Do whatever you like, and experience his delay.
Expected behavior
Load more smoothly, rather than waiting for him for too much time in front of the screen :) .
Screenshots
not applicable
Versions and configuration
- OS: Windows
- OS Version: 10.0.26200.8457 (25H2)
- Game Version: cdda-experimental-2026-05-14-0958-dirty [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms] ]
Additional context
After the initial PR that removed charges for some items, we encountered serious performance issues, which were even described in the Doc. This problem was more severe for some players using PE, as their performance was even worse. At present, with more items having their charges removed, we need to carry out more performance optimizations.
Source: CleverRaven/Cataclysm-DDA