Alpha 14, Performance slowly degrading, game simulation speed slowing down

I’ve been playing the recent release of alpha 14 and enjoying it a lot. From balance and gameplay, this version is a lot improved compared to alpha 13.

Summary:
After ~3h the game started slowing down and gameplay got choppy. Interestingly enough, the cpu is dominated by lua(40-90%) and lua-gc(20-60%, with some time idle (0-20%), so it looks completely different to my experience of previous alphas.

Steps to reproduce:
Unknown:

  1. play for 3h???

Expected Results:
Game is stable without degrading performance…

Actual Results:
Game slows down, and screen movement and animations gets choppy.

Notes:
Except for playing “normally”, I’ve been digging out a moat to turn my peninsula into an island. I got an assert when the moat part still building was flooded with water. The game worked fine after that, so I’m not sure if it is related.

Initial scaling (when cpu usage were dominated by astar and bfs path finding) seemed to suggest a max of around 20 hearthlings.

Attachments:
Save game:1453564158744.zip (8.0 MB)
Problem exists right away for me when loading this game.

Here is some screenshots in quick succession. showing cpu usage on “normal” speed:

Versions and Mods:
Version develop 2807
No mods

System Information:
Intel Core i5 760, @2,8GHz
64bit windows 7 sp 1
8GB ram
Graphics Chipset
AMD Radeon R9 200 Series
Driver Packaging Version
15.30.1025-151117a-296575C (latest)

Edit:
I formatted this as bug report, but this is still an improvement of performance and stability compared to other alphas. I just wanted to give input for future optimizations :slightly_smiling:

Edit2:
Real time playing was ~3h after a closer look at saves, see comment further down. Not the 10h I originally wrote, that was 2 play troughs together which I mixed up.

Thanks for the detailed report @Chymor, and the save game! Going to page @Ponder and @Albert to see this, as this is likely very helpful as they continue to work on performance improvements. I know @Albert is still working hard on some memory leak and threading related things, so I would love to find out if you were playing this game for 10 hours straight, or if you saved and reloaded the game at all?

Thanks!

Ok, I went over time on my saves, and it turns out I had two overlapping play troughs mixed up. So in this case the real game time is more like 3h. Also I know I have save/reloaded at least once in an attempt to recover performance. I’ve also reloaded the UI at least once.

I checked memory and cpu usage through the resource monitor when I did the save/reload and the two stonehearth processes went from ~3.5GB + 1.5GB to 1.3GB and 300MB after the save/reload, so there are significant amounts of memory restored by a save/reload.

If it’s interesting I can keep track of the saves next time I do a longer single session play through without reloading, but I’m uncertain of what info there is to get from that other than the fact stonehearth generates temporary objects that are not released.

If they were stored in save files stonehearth would consume the same resources upon reloading it, but since it doesn’t there’s clearly some non persistent data leaking.