Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Lag spikes in rendering thread #27

Open
NXTler opened this issue Sep 16, 2024 · 8 comments · May be fixed by #29
Open

[Issue] Lag spikes in rendering thread #27

NXTler opened this issue Sep 16, 2024 · 8 comments · May be fixed by #29

Comments

@NXTler
Copy link

NXTler commented Sep 16, 2024

I'm currently creating a performance Modpack and during testing with Moonrise I noticed large lag spikes during chunk generation/loading. Taking a look at F3 + 2 profiler, I noticed that Moonrise sometimes seems to utilize the rendering and the client thread, causing stuttering.
My suggestion is to maybe blacklist the client and rendering threads to prevent this from happening.

@jpenilla
Copy link
Member

Better thread management than vanilla is already part of the mod, it reduces frame spikes when generating/loading chunks by reducing vanilla's overallocation of threads to chunk gen and background tasks (see the render and util_thread_counts mixins). However, some of this is undone when Sodium is installed. #29 should fix the frame time spikes you were noticing. I'm also not quite sure what you mean by the suggestion in the last sentence.

@jpenilla jpenilla linked a pull request Sep 17, 2024 that will close this issue
@NXTler
Copy link
Author

NXTler commented Sep 17, 2024

I did test the mod with just FabricAPI and ModMenu installed, which shouldn't affect anything, and I was still observing large lag spikes on the rendering thread. I also tested the mod with VulkanMod, which shouldn't modify threading in any way, to rule out lag spikes from chunk loading and a very similar behavior was observed.
Please excuse my very bad phrasing in my previous suggestion. I essentially meant that using the rendering thread for chunk generation, I/O, ect. should be avoided to reduce these lag spikes.

@Skullians
Copy link

Do you still experience the same issue without moonrise…?

@NXTler
Copy link
Author

NXTler commented Sep 17, 2024

No, it's only happening with Moonrise installed.

@NXTler
Copy link
Author

NXTler commented Sep 18, 2024

I created three videos to better showcase the issue. The first one is just vanilla, the second one is just Moonrise and the third one is VulkanMod with Moonrise to rule out chunk loading issues. For Vanilla and VulkanMod I also used F3 + A to show the effect of chunk loading on frame time, but the beginning is a bit cut off for some reason.

Vanilla.mp4
Moonrise.mp4
VulkanMod.Moonrise.mp4

@NXTler NXTler changed the title [Suggestion] Better thread management [Issue] Lag spikes in rendering thread Sep 20, 2024
@NXTler
Copy link
Author

NXTler commented Sep 20, 2024

Any clue what might cause this?

@kennytv
Copy link

kennytv commented Sep 20, 2024

Chunks aren't generated on the render thread, what jmp was referring to is bad thread management taking away processing time/threads from other things. He also made #29 to reduce light processing load

@NXTler
Copy link
Author

NXTler commented Sep 20, 2024

I see, thanks for the insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants