View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005986 | Dwarf Fortress | Dwarf Mode -- Interface, Designations | public | 2012-06-04 03:26 | 2013-12-07 04:30 |
Reporter | Leonassan | Assigned To | |||
Priority | urgent | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | IBM Compatible | OS | Windows 7 64 SP1 | OS Version | 6.1.7601 |
Product Version | 0.34.10 | ||||
Summary | 0005986: Designating large areas for smoothing slows game to a crawl | ||||
Description | Whenever I designate large areas of the fortress for smoothing, the game drops to single digit FPS. The larger the area, the higher the impact, and it gradually recovers as the area to be smoothed gets smaller. | ||||
Steps To Reproduce | Select large area to smooth. | ||||
Additional Information | This seems to have gotten worse as I've moved my fort deeper underground. Current area that is being smoothed is at level 44. | ||||
Tags | No tags attached. | ||||
|
Reminder sent to: Leonassan Does this reproduce in every fortress? If not, please upload a save demonstrating the problem to http://dffd.wimbli.com/ and post the link here. |
|
Done. I haven't managed to get a second fort deep enough to replicate, so here's the save. http://dffd.wimbli.com/file.php?id=6423 |
|
It's very apparent where the save currently is. I loaded it up and was at 7FPS, as soon as the dwarves finished their current engrave designation, it jumped to 31. |
|
I've been noticing similar behavior in a large, populous 40d fort. Could it be a consequence of the alleged "dwarves don't seek jobs, jobs seek dwarves" design? Unlike a designation for mining into solid rock, a smoothing designation often creates a large number of simultaneously reachable tasks. If all those tasks go looking for an engraver once every N steps, we might see FPS drop significantly. The FPS drop might also depend on the number of dwarves in the fort: (CPU cycles used for smoothing job assignment) = K * n(reachable smoothing-designated tiles) * n(dwarves to check for availability as engravers). |
|
I also noticed this behaviour in previous versions of DF. |
|
Ran this through my profiling setup on Core i5 (got 20 FPS): http://cloud.github.com/downloads/angavrilov/dfprofile/log.slow-engrave.4a.svg Observations: 1) Engraving job creation does take more than 7% CPU; 5 of those is in the loop over all units, including dead. I would guess the function is called for every designated tile. 2) More than 15% CPU is used by searching for items by id - general_ref_item::getItem is obvious, but there are also other instances inlined in various other functions, e.g. 2% in map_block::updateTemp. 3) There are also other item-related functions mentioned, including things like the map renderer, which walks through all items on the map to check if they are visible now. This supports the generally accepted opinion that large number of units (2500+ on this map) and items (50000+) causes lag. Note: in viewing the graph bear in mind that true stack traces are unavailable, so the 'total time spent' percentage in parentheses is computed purely heuristically, and may significantly deviate from the truth. |
|
Perhaps pruning dead units from the units list will alleviate the problem. I'll try it and see if it helps any. I didn't notice the slowdown until after I breached the caverns, so that could be where the additional units are coming from. Perhaps the loop to check for units for a job should be limited to alive dwarves only? Edit: Also, to check the theory of large multiple accessible jobs, I've found the same behavior with mining designations that can all be reached, and massive dumping designations, so I believe you are correct that it has to do with a lot of tasks that can be completed being queued at the same time. Edit: Ok, I cannot remove dead units from the units list. |
|
> Ok, I cannot remove dead units from the units list. Of course you can't - you'd need DFHack to do something like that. |
|
> Of course you can't - you'd need DFHack to do something like that. Or since you can remove units from your alive, active dwarves list, this ability should be added to the Dead/Missing units list as well. |
|
Some experimental results: - Nuking all items except those in buildings and constructions got fps from 20 to 50. - Further 5 fps recovered by sealing that pump contraption - you should never make areas with changing water level reachable from the rest of the fortress. - What remained is 20% unit temperature update cost, 20% unit enemy/friend checks, 20% pathfinding through all those long and wide areas as units drag plants to stockpiles. Edit: here's the graph: http://cloud.github.com/downloads/angavrilov/dfprofile/log.slow-engrave.5d.svg |
|
I'm sure there are other things that are causing lag, but that doesn't change the fact that smoothing is causing lag :) |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-06-04 03:26 | Leonassan | New Issue | |
2012-06-04 08:10 |
|
Note Added: 0022846 | |
2012-06-04 13:39 | Leonassan | Note Added: 0022849 | |
2012-06-04 14:01 | Leonassan | Note Added: 0022850 | |
2012-06-05 03:21 | Mopsy | Note Added: 0022856 | |
2012-06-05 05:32 | blake77 | Note Added: 0022858 | |
2012-06-05 11:34 | ag | Note Added: 0022859 | |
2012-06-05 17:31 | Leonassan | Note Added: 0022865 | |
2012-06-05 17:32 | Leonassan | Note Edited: 0022865 | |
2012-06-05 17:34 | Leonassan | Note Edited: 0022865 | |
2012-06-05 18:13 | Quietust | Note Added: 0022867 | |
2012-06-05 18:17 | Leonassan | Note Added: 0022868 | |
2012-06-06 02:44 | ag | Note Added: 0022870 | |
2012-06-06 03:20 | ag | Note Edited: 0022870 | |
2012-06-06 12:54 | Leonassan | Note Added: 0022877 |