Create: Copycats+

Create: Copycats+

5M Downloads

[Bug] Lag spikes because of dynamic lights

Closed this issue ยท 2 comments

commented

Describe the bug
Moving dynamic lights source with enabled ModernFix mixin.perf.deduplicate_location=true causing lag spikes
image
This happens because CopyCats constructs new ResourceLocation very many times per tick at com.copycatsplus.copycats.compat.Mods.rl(), which shouldn't happen.
https://spark.lucko.me/FYo6L9kJjY
image

To Reproduce
Steps to reproduce the behavior:

  1. Modlist:
    image
  2. Add newline to modernfix-mixins.properties
mixin.perf.deduplicate_location=true
  1. Modify in betterf3.toml:
[general]
	always_show_tps = true

to see profiler graphics.
4. Take torch in hand and run. See lag spikes.

Desktop (please complete the following information):

  • Minecraft Version: 1.19.2
  • Mod Loader: Forge
  • Mod Version: 2.1.4
commented

I suggest to cache ResourceLocation. If it's new, call new ResourceLocation and add result to cache.
If it's in cache return from cache.

commented

We have already cached the resource location in a test build. It should be out soon:tm: if theres nothing wrong with it