sulis icon indicating copy to clipboard operation
sulis copied to clipboard

performance issue

Open bmorel opened this issue 2 years ago • 9 comments

Hello. This game makes one of my cores at ~90% CPU on title screen, pushing my CPU to it's maximum frequency (and that makes the fan noisy). From what I can tell, the remaining percents are syscalls. I know it's only an early version, though, but I thought it's be useful to report this anyway.

For technical infos: running on Debian, Intel(R) Pentium(R) Gold G5500 CPU @ 3.80GHz, no dedicated GPU (and I can, ofc, run many games without any problem). Using the binary distributed by website.

bmorel avatar Jan 08 '22 03:01 bmorel

Thanks for the report, I appreciate it!

That's interesting. Can you find your sulis.log file (most likely in ~/.config/sulis/log on your system) and attach it to this issue?

The frame rate is capped at 60 fps by default. I have a machine that's actually quite a bit weaker than yours and CPU usage generally stays below 10% there. So definitely something strange going on.

Grokmoo avatar Jan 08 '22 19:01 Grokmoo

Certainly sulis.log

I bet there's something strange here:

[2022-01-08 04:16:39.194927 +01:00] INFO [sulis_core/src/io/glium_adapter.rs:616] Rendered 167135 frames with total render time 114.8613 seconds

The number... It would mean 1466 frames per second! For a start, I doubt my system is able to do that, so the count feels wrong, and second, that's a bit too much :) At 60 FPS, it should be 6840 frames.

ghost avatar Jan 09 '22 01:01 ghost

I actually think that the frame rate number likely is accurate - it is rendering frames as fast as possible when it should be capped to 60 (by default). Hence, using up all of your CPU.

I'm not exactly sure how that could happen - can you also attach your config.yml file (most likely in ~/.config/sulis).

Grokmoo avatar Jan 15 '22 05:01 Grokmoo

Compressed it becuase annoying github. Note that I didn't touched anything in config IIRC. config.tar.gz

ghost avatar Jan 15 '22 14:01 ghost

Thanks for your help. Unfortunately yes, those are the default settings so I am still guessing at what the problem might be. Will continue to think about it.

Grokmoo avatar Jan 16 '22 01:01 Grokmoo

YW. If I can help more, feel free to ask, but I don't know anything about rust (if that was some C or C++, I could have provided a lot more info, because I know the toolchains well), so I can only help by reporting infos and testing.

ghost avatar Jan 16 '22 14:01 ghost

Pushed a potential fix for this in 099da3680fa31b704bfe405ca872ea2c51c90a36.

There also a change in winit that isn't yet in a release that could be impacting this: https://github.com/rust-windowing/winit/commit/0e52672f4aea376c3ef8a06b64aedca46a40e9b8 Will update the winit dependency once that is released.

Grokmoo avatar Mar 31 '22 03:03 Grokmoo

Hello. Is there is a published release with that fix, so that I can test and (hopefully) close this issue? Sorry I was rarely present on github those months (and it's not going to improve, but at least I want to see issues I've opened closed when possible).

ghost avatar Apr 29 '22 19:04 ghost

i build the master branch and have currently an fps of 171, the 0.6.0 binaries had an fps of over 200 on my notebook

stop5 avatar Aug 09 '22 16:08 stop5

Sorry for that (and not having checked out earlier), but apparently when I run the game I still do not have a 60 FpS, but rather a several hundreds of those, making CPU run at full speed.

ghost avatar Aug 11 '23 12:08 ghost

Thanks so much for checking into this after all this time. I will take another look.

Grokmoo avatar Aug 14 '23 03:08 Grokmoo

I've got a linux laptop with an integrated intel gpu and a dedicated nvidia gpu. I enabled vsync in glium and my framerate drop from ~300 to 60. I've submitted a PR with the change, can't test it on windows or any other devices though.

johnlauder avatar Oct 17 '23 17:10 johnlauder

Fixed in e71fbee3489e8c1cc6f560ea2c1608da9244f4dd

Grokmoo avatar Oct 18 '23 06:10 Grokmoo