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

Big world loading time increase #385

Open
3 tasks done
MikiP98 opened this issue Dec 21, 2024 · 5 comments
Open
3 tasks done

Big world loading time increase #385

MikiP98 opened this issue Dec 21, 2024 · 5 comments
Labels
bug Something isn't working status: more info needed Further information is requested

Comments

@MikiP98
Copy link

MikiP98 commented Dec 21, 2024

Describe the bug

When using C2ME the world loads (from main menu to in game) much slower
The "loading animation" square also gets larger during loading with C2ME

Here are some benchmarks:

  • 1.20.1 (0.2.0+alpha.11.13):
    • ModernFix + Lithium + ForceClose + {other}:
      • Time from main menu to in-game was 2.3785412 seconds
      • Time from main menu to in-game was 2.3924756 seconds
    • C2ME + ModernFix + Lithium + ForceClose + {other}:
      • Time from main menu to in-game was 7.265278 seconds
      • Time from main menu to in-game was 7.41052 seconds
  • 1.21.1 (0.3.0+alpha.0.308):
    • Time elapsed log
      • Vanilla
        • 342 ms
        • 381 ms
      • C2ME
        • 719 ms
        • 985 ms
        • 3696 ms
      • ModernFix
        • 396 ms
        • 392 ms
        • 466 ms
      • C2ME + ModernFix
        • 709 ms
        • 1825 ms
        • 2597 ms
    • Time from main menu to in-game log
      • ModernFix:
        • Time from main menu to in-game was 5.5785103 seconds
        • Time from main menu to in-game was 4.4354167 seconds
        • Time from main menu to in-game was 4.347621 seconds
      • C2ME + ModernFix:
        • Time from main menu to in-game was 6.7026525 seconds
        • Time from main menu to in-game was 6.3450956 seconds
        • Time from main menu to in-game was 7.545497 seconds
      • C2ME + ModernFix + Lithium + ForceClose:
        • Time from main menu to in-game was 7.1885076 seconds
      • ModernFix + Lithium + ForceClose:
        • Time from main menu to in-game was 2.2565756 seconds

Using ModernFix + Lithium + ForceClose alone offers over 3 times faster world loading speed then adding C2ME on top

To Reproduce

Steps to reproduce the behavior:

  1. Install optional mods:
  • ModernFix for better logging
  • Lithium and ForceClose for bigger C2ME loading time difference
  1. Open the same world with C2ME and without it
  2. Check respective logs and see that Time elapsed: --- ms or Time from main menu to in-game was --- seconds log is larger with C2ME installed

Expected behavior

I would expect C2ME to increase world loading speed and not decrease it, or at least not increase the time required or make that increase small.

Runtime info (please complete the following information):

  • OS: Windows 11 (23H2)
  • Minecraft version: 1.20.1, 1.21.1 and 1.21.4
  • Mod version: 0.2.0+alpha.11.13, 0.3.0+alpha.0.308 and 0.3.2+alpha.0.10 devbuild
  • Mod branch: Modrinth latest

Crash reports / logs

Those are a lot of log files, if you want them I can provide them, just write a comment with the request.

Other mods

  • ModernFix provides nicer to use Time from main menu to in-game was --- seconds logs, but it is not needed to reproduce
  • Lithium and ForceClose seem to increase the gap between NO C2ME and C2ME

Checklist

Additional context

If this is normal or if there is a config value I can change to "fix" this, pls tell me and I can close the issue.
If that would be the case though, maybe mention this somewhere in the README or FAQ

@MikiP98 MikiP98 added the bug Something isn't working label Dec 21, 2024
@ishland
Copy link
Collaborator

ishland commented Dec 22, 2024

1.20.1 and 1.21.1 are considered legacy and LTS at this point. Try reproduce on current 1.21.4 alpha versions.

@ishland ishland added the status: more info needed Further information is requested label Dec 22, 2024
@MikiP98
Copy link
Author

MikiP98 commented Dec 22, 2024

I kind-off expected this answer...
Well, here are the benchmarks for 1.21.4 latest Modrinth alpha C2ME (0.3.2+alpha.0.10 devbuild for 1.21.4):

  • vanilla logs:
    • vanilla:
      • Time elapsed: 2248 ms
    • C2ME:
      • Time elapsed: 4323 ms
    • ModernFix:
      • Time elapsed: 366 ms
    • ModernFix + C2ME:
      • Time elapsed: 5204 ms
    • ModernFix + Lithium + ForceClose:
      • Time elapsed: 4195 ms
      • Time elapsed: 441 ms
      • Time elapsed: 420 ms
    • ModernFix + Lithium + ForceClose + C2ME:
      • Time elapsed: 3643 ms
      • Time elapsed: 5273 ms
      • Time elapsed: 5752 ms
  • ModernFix (compiled 1.21.4 version) logs:
    • ModernFix:
      • Time from main menu to in-game was 4.5887103 seconds
    • ModernFix + C2ME:
      • Time from main menu to in-game was 8.349037 seconds
    • ModernFix + Lithium + ForceClose:
      • Time from main menu to in-game was 9.39382 seconds
      • Time from main menu to in-game was 2.6702216 seconds
      • Time from main menu to in-game was 6.0601377 seconds
    • ModernFix + Lithium + ForceClose + C2ME:
      • Time from main menu to in-game was 8.382937 seconds
      • Time from main menu to in-game was 12.814531 seconds
      • Time from main menu to in-game was 12.556423 seconds

Less consistent, but still present and visible
The loading animation square without C2ME gets much smaller then with it present

@ishland
Copy link
Collaborator

ishland commented Dec 23, 2024

My test results is nowhere near extreme as yours:
Using Sodium + Lithium + ModernFix + kennytv's epic force close loading screen mod for Fabric

# w/ C2ME vanilla timer w/ C2ME modernfix timer w/o C2ME vanilla timer w/o C2ME modernfix timer
1 1026 ms 4.579643 seconds 566 ms 3.033444 seconds
2 421 ms 1.541495 seconds 81 ms 0.84491324 seconds
3 477 ms 1.511551 seconds 61 ms 0.8454265 seconds
4 454 ms 1.3941115 seconds 39 ms 0.8361564 seconds
5 432 ms 1.4955388 seconds 43 ms 0.82268804 seconds
6 426 ms 1.4935144 seconds 78 ms 0.8239221 seconds
7 481 ms 1.523005 seconds 39 ms 0.9328617 seconds
8 481 ms 1.3849019 seconds 83 ms 0.8933754 seconds

The point is:

  • Not everyone care about startup time, as this kind of startup time is nowhere near the "loading screen simulator". What most people care about is the experience after they join the world.
  • We include optimizations that trade startup time for better peak performance, for the reason above.
  • We do not implement the loading square reduction. The vanilla chunk system is more reactive, and ours is more proactive. It is usually not a issue unless you are trying to run singleplayer with only 256MB of memory allocated (you shouldn't).

@MikiP98
Copy link
Author

MikiP98 commented Dec 23, 2024

I guess the loading time increase will be dependant on the hardware and such.

Not everyone care about startup time

Yeah, I understand, if this is expected, feel free to close this issue, though PLS add a warning that world loading times might be increased somewhere in the README (and Modrinth description)
Mod that makes the chunks generate and load faster should decrease world loading time if one thinks about it, and someone might be surprised just as me.
I noticed this in dev environment trying to decrease the loading times, in normal use case this really is just a minor cost to pay for the benefit during gameplay

We do not implement the loading square reduction

I've never understood why this thing even exists... Ksyxis removed it with no issue, other mods reduced its range, it seems pointless, and whatever the loading square reduction is it would be really nice to have it later down the line if possible

@ishland
Copy link
Collaborator

ishland commented Dec 23, 2024

though PLS add a warning that world loading times might be increased somewhere in the README (and Modrinth description)
in normal use case this really is just a minor cost to pay for the benefit during gameplay

If it is not really a problem for "normal use case", I don't see why I need to add that to the page.
Aside from that, creating a new world is still faster despite having a lot to do on startup. I would consider this a main use case for me in dev.

# w/ C2ME vanilla timer w/ C2ME modernfix timer w/o C2ME vanilla timer w/o C2ME modernfix timer
1 1504 ms 7.1929045 seconds 3399 ms 9.584665 seconds
2 666 ms 2.5205371 seconds 2547 ms 4.7889953 seconds
3 582 ms 2.461617 seconds 2347 ms 4.650655 seconds
4 555 ms 2.2917397 seconds 2253 ms 4.494829 seconds
5 513 ms 2.3026698 seconds 2291 ms 4.5527096 seconds
6 622 ms 2.2673268 seconds 2254 ms 4.5154085 seconds
7 543 ms 2.289952 seconds 2345 ms 4.442491 seconds
8 554 ms 2.3165977 seconds 2223 ms 4.5070066 seconds

I've never understood why this thing even exists

Originally, the spawn chunks have a radius of 10 chunks. This can be treated as a warmup for the world generation and loading, ensuring that chunk loading is not initially as slow as a crawl in front of you. Therefore, I'm not really a fan of vanilla reducing the spawn chunk radius.

The vanilla behavior of "loading animation square being smaller" is a change in 24w19a:

  • When reading an already generated chunk from disk, surrounding chunks are no longer unnecessarily loaded, reducing memory and CPU overhead.

While this change is called an optimization, it does have negative effects. For example, attempting to generate new chunks at the border of already generated chunks will cause a noticeable lag in chunk loading, because it has to reload all surrounding chunks for world generation. Therefore, this is currently not implemented.
If there is a need to introduce this behavior, I can consider implementing it down the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: more info needed Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants