JourneyMap Integration

JourneyMap Integration

16M Downloads

[Bug] Big performance loss when rendering FTB Chunks overlay

DedMaxim opened this issue · 9 comments

commented

While rendering big claims, performance drops significantly. On my system, disabling the overlay render roughly doubles the FPS.
Video demonstration:
https://drive.google.com/file/d/1YpbO3zxyp0TxAoVd3lZ5e0BLED3PqcdT/view?usp=sharing

Environment:
Intel Xeon E5-2680v2
Nvidia GTX 1070
4x8Gb DDR3 ECC REG RAM
Windows 10 22H2

Minecraft 1.20.1
Forge 47.2.20
Architectury 9.2.14
FTB Chunks 2001.2.7
FTB Library 2001.1.5
FTB Teams 2001.2.0
Journeymap 5.9.20
JMI 0.14-45

commented

JMI does not contain the overlay render logic. Those overlays are rendered by JouurneyMap it self so I think I can't do much for this

but I'll leave this issue open until I have investigated it

commented

JourneyMap dev here, We have done a lot of optimizations on polygons. I imagine it has to do with your server cpu, they are not usually ideal for games and MC is very CPU heavy.

Can you get me a spark client profile? https://spark.lucko.me/ download the mod for your modloader and version of minecraft.

When you get in game, type the command /sparkc profile start I believe it is, then open the fullscreen map with all the polygons, enable and disable them a few times, move the map around. Then exit the fullscreen map and run /sparkc profile stop

It will give you a link in chat and then respond here and provide the link please so I can take a look.

All done! https://spark.lucko.me/iBekFRdM3w
Video of the process https://www.youtube.com/watch?v=TBOcXc_jiHg

commented

JourneyMap dev here, We have done a lot of optimizations on polygons. I imagine it has to do with your server cpu, they are not usually ideal for games and MC is very CPU heavy.

Can you get me a spark client profile?
https://spark.lucko.me/ download the mod for your modloader and version of minecraft.

When you get in game, type the command /sparkc profile start I believe it is, then open the fullscreen map with all the polygons, enable and disable them a few times, move the map around. Then exit the fullscreen map and run /sparkc profile stop

It will give you a link in chat and then respond here and provide the link please so I can take a look.

commented

Thanks for sharing.
Looking at this, first I would suggest adding more Ram to minecraft, 8gb instead of 5gb. Might help a bit, might not. But for modded minecraft even with a low amount of mods. 8gb is usually best.

I am not seeing a whole lot in the spark profile. Polygon drawing is taking quite a bit of rendering time. But the debug screen is taking a lot more time drawing the text. Which is really strange, maybe try another profiling without opening the debug screen, I feel it is skewing the results. Drawing the text on that screen should not take 42% of the rendering time.
You may be hamstrung a bit with your 12 year old server cpu that is not really designed for gaming.

A single large polygon like you have is not complex either, it is trivial to render that. We did a lot of optomizations for polygons that have a lot of edges and holes since the math on those is pretty intense. But a single square is really quite easy with opengl.

@frank89722 in this example, is this one single polygon or a polygon per selected chunk? Ideally it should be a single polygon with each corner being a point?

if you look at this.
Top line is the debug screen @42%
Middle line is fullscreen map and polygon rendering @23%
Bottom line is game world @23%
image

commented

Thanks for sharing. Looking at this, first I would suggest adding more Ram to minecraft, 8gb instead of 5gb. Might help a bit, might not. But for modded minecraft even with a low amount of mods. 8gb is usually best.

I am not seeing a whole lot in the spark profile. Polygon drawing is taking quite a bit of rendering time. But the debug screen is taking a lot more time drawing the text. Which is really strange, maybe try another profiling without opening the debug screen, I feel it is skewing the results. Drawing the text on that screen should not take 42% of the rendering time. You may be hamstrung a bit with your 12 year old server cpu that is not really designed for gaming.

A single large polygon like you have is not complex either, it is trivial to render that. We did a lot of optomizations for polygons that have a lot of edges and holes since the math on those is pretty intense. But a single square is really quite easy with opengl.

Unless @frank89722 in this example, is this one single polygon or a polygon per selected chunk? Ideally it should be a single polygon with each corner being a point.

if you look at this. Top line is the debug screen @42% Middle line is fullscreen map and polygon rendering @23% Bottom line is game world @23% image

Done, without F3 overlay https://spark.lucko.me/qcr4Lkchms
Video https://www.youtube.com/watch?v=8f-gG59f5I4

Regarding memory, my client is run with arguments Xmx 8g and Xms 256m, so it has 8gb available, it's just not using as much at the moment.

Regarding the CPU, yeah, I know it's quite old but, well, it got a lot of cores and cache, at least. I am aware that Minecraft is the game that takes advantage of high clocks, not cores. Mine is running at 3.1 GHz, which is not much by modern standards but there are lots of people who has even less performant systems with CPUs like older i3 or laptop CPUs, which typically don't clock very high. Or, well, previous CPUs, but there are a lot of such systems still.

And regarding performance in general, well, it always has been this way in Minecraft that any GUI elements add lag? The only question is just how much. I remember it being a problem in older versions with other CPUs I had, i5 6400 and even older Core 2 Duo e7600. Pressing F1 always made FPS go up by a lot. In this case, if I disable Journeymap and F3 screen, I get around 320 fps standing still in spectator mode in the same world as in the video. If I enable Journeymap with F3 disabled and all other stuff the same, I get around 210 fps. Now if I enable FTB overlay on top of what's mentioned above, I get 64 fps with that massive claim covering the whole minimap. And now with all this if I enable F3, I get around 49 fps - more than 6 times less than what I had without any GUI elements. However, in the case of this issue, the question is just that deduction from 210 fps to 64 fps with the only difference is FTB overlay being enabled.

commented

Ahh okay, Spark is reporting much less memory allocated vs available.

I have not experienced fps drops with generic screens, at least not noticeable drops. The new spark profile you shared, the polygons are not taking nearly as much rendering time as level rendering, it is a bit strange that you are getting such an FPS drop. I need to do some testing on my end with more indepth profiling to see if there is some inefficiencies going on I can address.

commented

I had a chat with @frank89722 currently he's create a new polygon for each chunk instead of making it all only polygon.
When he gets time he'll update so that it is all a single polygon. This should help performance significantly for you I think.

commented

I had a chat with @frank89722 currently he's create a new polygon for each chunk instead of making it all only polygon. When he gets time he'll update so that it is all a single polygon. This should help performance significantly for you I think.

Awesome! Also, continuing this topic, is is possible to implement a setting that would specify how frequently the map gets updated? As the map gets updated every N frames with that number configurable. Because the map itself also adds some load. Or will it just cause lag spikes and that's all?

commented

Awesome! Also, continuing this topic, is is possible to implement a setting that would specify how frequently the map gets updated? As the map gets updated every N frames with that number configurable. Because the map itself also adds some load. Or will it just cause lag spikes and that's all?

The render delay setting

https://teamjm.github.io/journeymap-docs/latest/Client%20Docs/settings/cartography/