Performance regression in the crafting menu

Author: iamthememoryCreated Aug 16, 2026Updated Sep 18, 2026
Labels(S2 - Confirmed)

Describe the bug

The performance of opening, searching, or switching tabs within the crafting menu near large numbers of items has slowed significantly.

Attach save file

Crafting-trimmed.tar.gz

This is a debug-derived save which illustrates the problem, using a single tile full of sand.

Steps to reproduce

From the provided save

  1. Open the crafting menu.
  2. Tab between the crafting tabs.
  3. Note that it may take several seconds to load each.

From a new world

  1. Via the debug menu, set all skills to 10.
  2. Unlock all recipes in the debug menu.
  3. Spawn 4096 sand via the debug menu.
  4. Optionally, drop the sand. This might make the performance drop more noticeable, although I didn't time it.
  5. Remove the Debug Hammerspace mutation if your character has it.
  6. Open the crafting menu and tab between the tabs, noting that it may take several seconds to load each.

Expected behavior

Previously, the crafting menu loaded significantly faster. For example, on an admittedly heavily modded save (not provided), the loading time has gone from a second or two to half a minute or more.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version:
  • Game Version: 0.J [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [ Dark Days Ahead [dda] () ]

Although the above doesn't include it, likely due to an error on my part in how I'm building it, the save was generated with e8d93eaa0d7fd4a622209359a1c6ff59f5343b60, which exhibits the slowdown.

Additional context

I haven't bisected it, but 121ee8f6cb0e2cc410ca87ad4258678c757f0b41, from about a week ago, doesn't have this performance issue, while e8d93eaa0d7fd4a622209359a1c6ff59f5343b60 does.

My own attempts at profiling have shown that a lot of time is spent in provider_quality_level, and I suspect this regression may have been introduced in #88292, although I don't know enough about the code in question to speculate on how to improve it:

Flamegraph

Please let me know if you need any further information.

Source: CleverRaven/Cataclysm-DDA