Canvas Renderer

Canvas Renderer

202k Downloads

Huge FPS drops when rendering Chunks

UltraBlackLinux opened this issue ยท 16 comments

commented

The FPS just drop down from 200 to 0 fps until everything is loaded - with 11 chunks render distance. Example: hypixel lobby.

Please do something about this :/

Thanks!

commented

a log may be helpful here, cannot recreate this

commented

Confirmed on this unit except it's multiple lag spikes in singleplayer worlds when loading new chunks.

Unit used:

Java: AdoptOpenJDK 11 (HotSpot),
CPU: Intel(R) Xeon(R) CPU E5-1630 v4 @ 3.7 GHz,
GPU: NVIDIA GeForce GTX 1650,
OS: Windows Server 2019 Standard (64-bit).

commented

Correct, without a log and version number will be difficult to do much. In particular, version number. It's possible the latency in getting chunks from the server is somehow clobbering the render thread.

commented

Config:
canvas.txt
Even cleared my config, only small improvement...
The fps are worse if you move while the chunks are loading

[09:17:50] [main/INFO]: ==================  CANVAS RENDERER DEBUG INFORMATION ==================
[09:17:50] [main/INFO]:  Java: 1.8.0_265 64bit
[09:17:50] [main/INFO]:  CPU: 12x AMD Ryzen 5 2600X Six-Core Processor
[09:17:50] [main/INFO]:  GPU: Using framebuffer using OpenGL 3.0  3.2.2 build 10
[09:17:50] [main/INFO]:  OpenGL: Radeon RX 560 Series (POLARIS11, DRM 3.39.0, 5.9.11-3-MANJARO, LLVM 11.0.0) GL version 4.6 (Compatibility Profile) Mesa 20.2.3, X.Org
[09:17:50] [main/INFO]:  VboArb: N  VaoEnabled: Y  VaoArb: N
[09:17:50] [main/INFO]:  (This message can be disabled by configuring logMachineInfo = false.)
[09:17:50] [main/INFO]: ========================================================================

canvas-mc116-1.0.1202

@grondag @IMS212

commented

Also, please let me know your settings for VSync and framerate limit configured in Video settings. At least one user has reported this seems to make a difference. (Disabling frame rate limit seems to help.)

commented

VSync Disabled
https://paste.ee/p/90fA8
@grondag tried multiple times

commented

If you are still having this problem, please do the following to help me gather more information:

  1. install build 1229 or later
  2. start your game in the world where the problem happens
  3. in the Canvas config menu, at the bottom, turn on "Log Render Lag Spikes"
  4. load some chunks and observe the problem
  5. provide a link to your entire log here

You'll want to turn off that debug feature after.

commented

Thank you for the extra detail.

Most of the lag spikes seems to be caused by light updates, which is vanilla code that Canvas doesn't touch. Those spikes also happen without Canvas, but because Canvas optimizes most of the code around them, they are much more noticeable. They may also be more concentrated because Canvas calls up chunks to be loaded more quickly.

Canvas will probably make some improvements to lighting in the future, but for now your best bet is to install Lithium and Phosphor. Both are compatible with Canvas and in my testing they help significantly.

I will close this for now because there doesn't appear to be anything I can do about it, but would like to know if those mods help or if there is some reason you can't use them.

Thank you again for the report.

commented

@grondag I just found something out: The well known chunklag seems to be caused by lighting upates:
Lag spike at WorldRenderer-LightUpdates - 101,839,834ns, threshold is 33,333,333ns

commented

@grondag I just found something out: The well known chunklag seems to be caused by lighting upates:
Lag spike at WorldRenderer-LightUpdates - 101,839,834ns, threshold is 33,333,333ns

Yep, that's what I was referring to here:

Most of the lag spikes seems to be caused by light updates, which is vanilla code that Canvas doesn't touch. Those spikes also happen without Canvas, but because Canvas optimizes most of the code around them, they are much more noticeable. They may also be more concentrated because Canvas calls up chunks to be loaded more quickly.

As far as I can tell, this is a normal vanilla performance limitation we don't normally notice because Vanilla slows down client-side chunk loading by being generally not very efficient. I do find that Lithium and Phosphor help smooth these out a bit.

commented
commented

@grondag sorry for another ping xD
https://github.com/PhiPro95/mc-fixes/

Interesting. Not compatible with Phosphor which seems to be a little better in my testing, but glad to see people working on it.

commented

@grondag I wonder if you'd be interested in this

https://gist.github.com/spiralhalo/00a9ffd66b8ffd08a191618b207b8f06

According to the logs, lag spikes are happening from other things than light updates. Mostly entity render and terrain update. Should also note that I'm playing with a lot of mods at the time of logging.

commented

After increasing my Java memory limit from 2G to 4G I was able to nuke a 3rd world (see footnote on my previous comment for context) and only brushed 4GB memory usage momentarily before gc kicks in and brought memory usage back to 2.5-3GB range. Conclusion: Canvas needs more memory than vanilla (likely not a memory leak). I hope someone finds this information as useful as I do.

commented

So, I noticed that the frame rate drops were bad, sometimes worse than vanilla, which shouldn't be possible.

As my testing progresses, I'm leaning towards the theory that this is possibly a memory issue rather than a performance issue, at least in my case. Something that Canvas does just seem to fill up the memory faster than vanilla (although vanilla's gc isn't that much better).

I'm going to do some tests with higher java memory limit to see if it's a memory leak or not, and open a new issue if that was the case.

footnote:
Here is how my testing goes:

  1. Use the tech reborn mod
  2. Nuke a new world 4 times
  3. Create another world and nuke it 4 times

Vanilla/indigo hits 90+% memory usage after the test ends, somewhat playable still. Canvas hits 99% memory usage right after loading the 2nd world, completely unplayable.

commented

This is a good catch. Canvas absolutely does want more memory than vanilla - it trades more generous memory allocation for CPU/GPU time whenever it can.

As I've written elsewhere, Canvas was never made to run on a potato. It's meant to fully use modern hardware and run faster than vanilla with extended features. 4GB is probably the minimum and it will stress your cooling, too.

I'll put something to that effect in the read me.