Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Let's be open about how these benchmark results were obtained

All results were obtained in a obfuscated Minecraft environment (see: normal, standalone client.) The results are intended to represent the amount of CPU time spent generating terrain, performing terrain population, and settling light updates. The results for each mod are collected by using clean Minecraft profiles with only the required mods installed for the specific benchmark run.

JProfiler was used in sampling mode (10ms resolution) to measure the CPU time taken by various methods in Minecraft. The two methods we look at are PlayerChunkMap#tick and WorldServer#updateBlocks.

Before we begin, we prepare the world we want to benchmark generation time for by teleporting to a fairly remote distance from spawn (~2500 blocks on the X/Z axis to prevent the initial server startup from pre-generating chunks and skewing our results). Once done, the following game rules are set for the world (and are used across all runs to minimize variance): doDaylightCycle=false doWeatherCycle=false doMobSpawning=false

We use two runs to warmup the JVM and load classes, and five runs afterwards in the same process to measure CPU time. A run consists of erasing the region data for an already existing Minecraft world and launching a singleplayer session for it. We only measure from the point the player joins the integrated server to the point where all chunks within the render distance are visible on the client. The player is not moved between any of the runs.

The initial warmup runs are discarded, and we combine the time spent in the two mentioned methods above for each run to roughly calculate how much CPU time was spent for each run. The results of each run are averaged together and we take the mean for our graphs.

An example of what this data looks like once collected for the Twilight Forest can be found below.

+-------------------+-----------+-----------+-----------+-----------+
|                   | Run 1     | Run 2     | Run 3     | Run avg.  |
+-------------------+-----------+-----------+-----------+-----------+
|Vanilla            | 150.319ms | 150.524ms | 151.147ms | 150.663ms |
| |- Generation     |  80.354ms |  80.274ms |  80.268ms |  80.298ms |
| |- Chunk Ticking  |  69.965ms |  70.025ms |  70.879ms |  70.289ms |
+-------------------+-----------+-----------+-----------+-----------+
|Phosphor 0.1.6     |  25.573ms |  25.392ms |  25.639ms |  25.534ms |
| |- Generation     |  23.751ms |  23.812ms |  23.721ms |  23.761ms |
| |- Chunk Ticking  |   1.822ms |   1.580ms |   1.918ms |   1.773ms |
+-------------------+-----------+-----------+-----------+-----------+
Linux Distribution: Fedora 29 TwentyNine
Linux Kernel: x86_64 Linux 4.20.16-200.fc29.x86_64
CPU: AMD FX-8370 Eight-Core Processor
RAM: 24GB @ 1833MHz (8GB/8GB/4GB/4GB)
GPU: GeForce GTX 960/PCIe/SSE2
Java Version: 1.8.0_192, Azul Systems, Inc.
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Azul Systems, Inc.
Java VM Maximum Memory: 5364 MB
Java VM Flags: (none)
Forge: 14.23.5.2768 for Minecraft 1.12.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.