CleverRaven / CleverRaven/Cataclysm-DDA

Large amounts of CPU being used on mission::process_all

Open
#62,057 18 comments 0 reactions 0 assignees View on GitHub
(S2 - Confirmed) [C++] Code: Performance Missions
Dominant language
C++
Stars
13.2k
Forks
4.6k
Avg merge
2d 1h
Merged PRs (30d)
205

Description

### Describe the bug

Exactly as it it says in the title, mission::process_all is taking up 57.74% of the total cpu, and it seems to go all the way down to item::has_flag with 43.42% of the total cpu and the highest self CPU.

I have no clue what could be causing this.

### Steps to reproduce

1. Load the save.
2. Wait for an hour and see how long it takes, or ideally profile it yourself and see that the same process is using up a large amount of cpu.

### Expected behavior

I was expecting that mission::process_all shouldn't use this much of the CPU and cause game time to crawl, but then again, what do I know?

### Screenshots

![Capture](https://user-images.githubusercontent.com/9687907/199566725-7b9027ba-eea9-4980-a70c-ba358188f540.PNG)

### Versions and configuration

- OS: Windows
- OS Version: 10.0.19043.2130 (21H1)
- Game Version: cca0c2b [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Extra Mutated Scenarios [extra_mut_scens],
Mining Mod [Mining_Mod],
SpeedyDex [speedydex],
No Rail Stations [No_Rail_Stations],
Massachusetts [MA]
]

### Additional context

Save file: https://drive.google.com/file/d/1iNm4xusioK6cGxgTYBujaYTBvSkrlo3g/view?usp=sharing

Contributor guide

Open the contributing guide

Research direction

Start by profiling the reported save around mission::process_all and item::has_flag, using the issue's reproduction steps and supplied save file. Compare the hot paths with and without the listed mods to isolate the cause. Done means identifying and fixing the excessive CPU use so game time no longer crawls, with profiling evidence confirming the improvement.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.