Skip to content

Shadowrs/minecraft-fabric-loader-benchmark-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fabric-Loader Loading Phases Visualizer for Minecraft

A plain-javascript single-page tool which parses the log4j formatted /log/debug.log file from a Minecraft Modpack. Based on the timestamps of various key log messages, calculates the time between phases and displays it on a bar graph.

alt

Give it a go using a dummy debug.log

Supplying your own debug.log

This tool requires some log messages not present in main Fabric repo. To run this tool on your own debug.log, you must use PolyMC or the MultiMC Launcher to run Minecraft with a replacement Fork of Fabric-Loader and Mixin repos.

  • On the Launcher UI, click Customize > Edit Instance > Select Fabric Loader > Edit. alt
  • This opens C:\Users\xx/AppData\Roaming\PolyMC\instances\All of Fabric 5 - AOF5 - 1.18.2\patches/net.fabricmc.fabric-loader.json in a text editor.
  • This file allows you to provide overrides for fabricMC's jars with Forks
  • Change the fabric-loader and sponge-mixin sections to point to the maven URL below.
        {
            "name": "net.fabricmc:sponge-mixin:0.11.4+mixin.0.8.5-local",
            "url": "https://repo.repsy.io/mvn/tardisfan/uno/"
        },
        {
            "name": "net.fabricmc:fabric-loader:0.14.8+local",
            "url": "https://repo.repsy.io/mvn/tardisfan/uno/"
        }
  • Modify launch options to include Java args: -Dfabric.log.debug.level=DEBUG -Dfabric.log.level=DEBUG

  • Optionally, if compatible with the mods in the modpack you're going to run, manually add the DashLoader mod to launch x2 faster. DashLoader replaces some of the last Minecraft phases of loading (related to models) with heavily optimized caching.

How it works

A simple string.contains() is performed on every line of the log. Patterns of unique log messages to matches are in messagesToMatch in index.html. The timestamp of each log message is parsed. All matches are sorted by timestamp, and the duration of each phase is nextPhase.start - thisPhase.start

Overview of Loading Phases

In order of execution:

Knot#init - preLaunch triggers mixin scanning. During classLoading of mixin classes, transformers are triggered:

MixinEnviroment constructor

MixinProcessor#applyMixins -> selectConfigs > prepareConfigs > postInit

Hooks#startClient

Minecraft blockstate, models, texture loading - this phase is a good 45% of the entire loading process. DashLoader mod replaces this entire phase with an alternate process which takes under 5 seconds!

The other largest chunk- 35% of loading time - is mixin transformers. Can this be cached or parallelized? QuiltMC's Chasm project aims to achieve that, and Fabric has wanted to approach this concept for a long time. discord message link

Thanks to

alt-text for the graph generation.

alt-text for date timestamp parsing.

About

A visualizer for the Loading Phases of the Fabric-Loader for Minecraft

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages