McModLauncher / modlauncher

Java 21 mod launcher
Other
171 stars 47 forks source link

Signed mod jars significantly slow down class loading #55

Closed malte0811 closed 4 years ago

malte0811 commented 4 years ago

I recently noticed that the "mod construction" phase took quite long for Immersive Engineering while profiling startup for a modpack, even when compared to mods of a similar size. Most of that time is spent loading classes. With help from @sfPlayer1 I tracked this down to jar signing:
ModLauncher parses the manifest every time it loads a class from a jar file (here). We seem to be one of the few teams that still uses signed jars in 1.16, so IE has a much larger manifest than most mods (roughly 735 kB compared to 25 bytes without signing). Storing the loaded manifest would significantly improve load times for signed mods and at least slightly for unsigned ones.

Startup times (time between the message "ModLauncher running[...]" and the last message of the form "[minecraft/AtlasTexture]: Created: [...]"):
Without any mods: 42-43 s (2 launches) With signed IE jar: 75-76 s or 32-34 additional seconds (3 launches)
With unsigned IE jar: 55-58 s or 12-16 additional seconds (2 launches)

Forge version: 32.0.107
ModLauncher version: 6.1.1+74+master.966c698

malte0811 commented 4 years ago

This is actually a Forge issue, not a ModLauncher issue, see the PR linked above.