Dynamic FPS

Dynamic FPS

16M Downloads

Optimization

andreasdc opened this issue ยท 12 comments

commented

Hey, I noticed that there is some room for improvement, I tried Idle Tweaks mod, it saves more resources, but it has some small issues. Do you think it's possible to optimize it in the background?
image
image
image

commented

Hello, I don't see where in your screenshot Dynamic FPS even shows up (maybe uh, highlight it next time?), but I've seen people mention before that polling the window for its status shows up in other profiler results. To resolve this I've recently implemented some changes via #110 (and #115 for smaller background usage), you can try grabbing the latest actions build (there's a .zip attached to each run) and see if it improves your situation.

commented

It is on top, but I meant reducing tick rates or maybe render distance when in the background. Making 15 fps in the background is expensive to, I personally have myself at 0. With Idle Tweaks mod O jhave c[i isage at arpimd 1% with occasional spikes to 4-5%, with DynamicFPS I had around 5-6% all the time. I'm going to test your latest version.

With the latest version I have around 2.5-3% of cpu usage with occasional spikes to 6%, but I don't know what is FPS frame target.

commented

It is on top

There's actually no mention of Dynamic FPS, if there was a mixin method being called it would show like this:
image

but I meant reducing tick rates or maybe render distance when in the background

There's an option as of version 3.0.0 to reduce graphics settings. You can choose between "reduced" which will turn off everything that will not cause the world to reload, or you can choose "minimal" which will reload the world due to the changed settings (which will use more resources in the background while it does this - I do not recommend it. This is also why there is no option to reduce render distance at this time).

As for tick rates you can in singleplayer at least just have the game pause when you unfocus the window, does this not do what you want? It's a vanilla option you can toggle with F3 + P.

Making 15 fps in the background is expensive to

The way Dynamic FPS works is that the client will "render" at 15 FPS, but if your target frame rate is set to 1 it will cancel rendering 14 out of those 15 frames, leaving only one actually being rendered. That is what makes resuming playing feel pretty much instant with Dynamic FPS, because it can start rendering the game at full speed from any of those 15th of a second instead of eg. once a second, and can not really be reduced lower unless we compromise on this.

but I don't know what is FPS frame target

You can choose the amount of FPS for each window mode, think of it as the "max FPS" option from vanilla.

commented

image
With graphic reduced I think there is 0.5-1% less cpu usage,
Did you add menu's fps limit to 60? Because it's lagging as hell

Also do you think these options are good?
image

commented

With graphic reduced I think there is 0.5-1% less cpu usage

Seems like it works then!

Did you add menu's fps limit to 60? Because it's lagging as hell

This is a somewhat experimental thing we did in versions 3.0.0 and 3.0.1, if you actually grab the version I asked you to from Github actions here this got removed again as it was evidently not a good idea. Download this file, there's a mod jar inside:
image

Also do you think these options are good?

If all you want is for it to not render anything and make no sounds? Sure. Personally I use the defaults because I play on a server where I want to hear things while the game is in the background.


As for your profiler image it is sadly still not helpful, as it is for an outdated version of the mod (2.4.0 or earlier).

Additionally, all it shows is that Dynamic FPS is making the game idle - as you can see the checkForRender() and then appropriately named idle() calls just wait for roughly 30 milliseconds, there's no computation being done. This is seemingly just an unfortunate limitation of how the profiler works.

commented

I hear now too, maybe it was something bugged or volume multiplier needed a restart.

commented

I have dynamic-fps-3.1.0-alpha+minecraft-1.20 I think it is the latest from https://github.com/juliand665/Dynamic-FPS/actions/runs/6123705945

commented

That is the latest yes. The profile you posted above is still for an old version of the mod anyway.

commented

Ok, because I still have the 60 fps limit. Having 0 fps makes sounds unhearable? Is there no way to fix that? This is the profiler from the latest version.
image

commented

Are you still using the config you screenshotted before? If so, you yourself set the volume multiplier to 0, muting sounds in the background.

As for the profiler, that looks like the mod is working as intended. The process keeps running of course, but it spends all its time simply idling and waiting to keep rendering, so it's not using your CPU in that glfwWaitEventsTimeout call.

commented

It is way better with the latest update yea, what a coincidence that I just reported it at the same time. ๐Ÿ˜„ I want to keep the volume, should I use volume 100 and frame rate 0?
I don't hear sounds when I'm in the background no matter of the settings

commented

should I use volume 100 and frame rate 0?

Sure.

I don't hear sounds when I'm in the background no matter of the settings

I've tested the combination of 0 FPS and having the volume on, it seems to work. Did you set it in all 3 of the config tabs?