AnOpenSauceDev / FastRandom

An optimized rewrite of Minecraft's RNG system, for Fabric!
Apache License 2.0
48 stars 3 forks source link

[BUG]: version 4.0.0 has FPS drop when entering world. #44

Closed davidromrell closed 6 months ago

davidromrell commented 6 months ago

Does an issue already cover this?

Does your system support Faster Random?

Issue description.

3.0.4 did not have this problem, unsure what you changed.

Issue replication.

enter a world with just your mod using 4.0.0 on 1.20.1 fabric

Log File / Crash Report (if applicable)

No response

AnOpenSauceDev commented 6 months ago

I cannot replicate this lag on Fabric/Quilt 4.0.0. (1.20.1 <-> 1.20.4)

davidromrell commented 6 months ago

its literally only for the first 30 seconds to a minute so you have to instantly check fps.

AnOpenSauceDev commented 6 months ago

Isn't that how joining a world works? My performance is always at ~90FPS after immediately joining both with and without Faster Random, before hitting ~1000 when all the chunks get built.

davidromrell commented 6 months ago

something in your mod is making the world joining worse, I am not the maker of this mod so i cannot say what. Although I can say something that changed between 3.0.4 and 4.0.0 significantly decreased gains of performance to the point where 4.0.0 is not worth using unless they want the specific changes you made.

AnOpenSauceDev commented 6 months ago

Nothing has changed? We just use nextLong instead of nextInt for feature generation, there shouldn't be any noticeable difference. In fact, performance should be better because of the laggy ChunkRandom workaround being removed.

davidromrell commented 6 months ago

Agreed that is why I was surprised.

acerola0rion598 commented 6 months ago

I tried creating a world and tp-ing to not generated chunks, when I'm at 32 render distance I hit ram limit faster and have less fps with 4.0.0 (than with 3.0.4), tho if I reduce the render distance so it doesn't hit the ram limit with 4.0.0 chunks are actually generated faster. So I don't think it's the dev's fault

davidromrell commented 6 months ago
  1. I accidentally changed java arguments 2. fabric had a version change which altered the performance gains from javaArgs and mod I believe due to altering render distance in some way. 3. My launcher had a bug in which it downgraded which file i was using. 4. GC i think is getting triggered by removing ChunkRandom.
AnOpenSauceDev commented 6 months ago

GC i think is getting triggered by removing ChunkRandom.

ChunkRandom isn't removed in 4.0.0, we just don't force ChunkRandom to use a slower random in order to prevent some mods from crashing anymore (because we fixed it in 4.0.0 :) ). Chances are, your ram is being flooded with new chunks, and you'll have to dedicate more RAM to not lag from all the GC.

Steveplays28 commented 6 months ago

its literally only for the first 30 seconds to a minute so you have to instantly check fps.

That sounds like average Minecraft, as AnOpenSauceDev said. The vanilla chunk manager blocks the server thread when loading chunks for players.

davidromrell commented 6 months ago

my minecraft doesn't have the

That sounds like average Minecraft, as AnOpenSauceDev said.

experience due to java arguments.

The vanilla chunk manager blocks the server thread when loading chunks for players

Sorta true, with my java args it is false, with "average minecraft" it is true.

davidromrell commented 6 months ago

As I stated fabric altered rendering distance:

Chances are, your ram is being flooded with new chunks, and you'll have to dedicate more RAM to not lag from all the GC.