Repository navigation
Rustcraft v0.0.6
Rustcraft v0.0.6: the sixth wave of the optimisation pass over the whole code base (15 changes), which settles every optimisation that v0.0.5 left switched off, and two fidelity fixes. Each change was reviewed and proven to change nothing the game or a server can see. Unofficial and work in progress: keep backups of worlds you care about.
Faster, measured
Same PC, quiet machine, v0.0.5 and this release alternated launch by launch, two runs per scene (three when two runs disagreed), 1600 × 900:
| Part of the game | v0.0.5 | v0.0.6 | Change |
|---|---|---|---|
| 64 TNT every 5 s: worst server tick | 26.9 ms | 16.9 ms | −37 % |
| 64 TNT every 5 s: slowest ticks (1 %) | 10.6 ms | 9.6 ms | −10 % |
| Heap of 1,728 TNT set off at once: worst server tick | 37.2 ms | 26.1 ms | −30 % |
| Heap of 1,728 TNT: slowest ticks (1 %) | 1.66 ms | 1.48 ms | −11 % |
| TNT volleys while a new world generates at render distance 32: worst server tick | 21.5 ms | 17.9 ms | −17 % |
| TNT volleys while a new world generates: slowest ticks (1 %) | 11.1 ms | 10.0 ms | −11 % |
| Integrated server tick, redstone | 1.48 ms | 1.17 ms | −21 % |
| Integrated server tick, cave | 1.10 ms | 0.89 ms | −19 % |
| Integrated server tick, new world | 0.67 ms | 0.63 ms | −7 % |
| Integrated server tick, plains at render distance 32 | 0.84 ms | 0.80 ms | −5 % |
| Integrated server tick, 1,000 mobs | 6.11 ms | 5.93 ms | −3 % |
| Slowest frames (1 %), plains at 32 / redstone / flight | 0.50 / 0.59 / 0.63 ms | 0.48 / 0.57 / 0.61 ms | −4 % |
| Frames per second, flight / TNT volleys | 3,582 / 3,448 | 3,641 / 3,512 | +2 % |
Frames per second elsewhere stay where they were (−1 to +1 %), and the server tick of the other scenes moves by −6 to +5 %. The frame rate during the blast of the TNT heap is unchanged (1,020 to 1,100 frames in its worst second, before and after).
The optimisations left off in v0.0.5, settled
Each one was measured alone on a quiet machine, against the release as it ships:
- On, because they win: explosion rays and visible parts on helper threads (without them, the worst tick of an explosion is 18 to 45 % longer).
- On, from their own measurements, nothing lost in the scenes: the smoothed light of the mesh (−5.6 % of the meshing time), the exit portal search on helper threads, spawn placement tested first, hidden-player lookup without its lock.
- Removed, because they lose or change nothing in a real scene: 17 switches and their code (2,547 lines). Among them, parallel draw lists (−14 % frames per second while turning the camera), the biome search's own thread pool (worst tick +9 to +12 %) and the light of new chunks resolved by tiles.
- The world saved differently on a very busy machine (the reason the tiles were off in v0.0.5): the cause was found and fixed. The light of the neighbouring chunks now always arrives before the new chunks. The tiles themselves brought nothing in the game, so they are gone.
- The few that stay off have their reason and figures written in
docs/perf.md.
What changed underneath
- Explosions: rays and the visible parts of the entities hit are computed on helper threads kept ready from the opening of the world, fed from one job queue.
- Integrated server: mob bodies read each cell once and reuse the boxes their movement kept for the ground search (97 % of the searches in a crowd of 1,000); commands build their reply only when someone receives it, read data in place, and read block filters and container slots once.
- Light: block changes are relit incrementally, the result checked by its uniqueness (this is the redstone gain).
- World generation: cave carving with a start pre-test and a reach box, the biomes of a batch computed as one tile.
- Save: chunks encoded and compressed side by side, faster compression, region files forced to disk only at closing.
- Client display: the meshing picks only the changed columns a view can show, like the game; biome tint skips its zoom in single-biome cells; the visibility graph keeps its clear sight rays per corner; improved transparency uses compact depth bounds (46 → 29 MB at 1600 × 900).
- Text: one shared translation table instead of copies.
- Measurement: new bench scenes (TNT while a world generates, the camera turned every frame, a rare biome search).
Closer to the game
- Effect swirls now appear around players and mobs under a potion or beacon effect, with the game's rules: chance per tick, fainter ambient effects, invisibility, colour of each effect. A spectator shows none.
- A torch placed or a hole dug near the edge of the explored world keeps its light when the world generates further. Before, the next generated chunk could wipe it.
- The creative inventory and recipe book searches follow a language change (before, they kept searching in the former language), and advanced tooltips (F3+H) no longer change their results.
Known
- Memory of the process is about 2 % higher on average (−1 to +4 %, up to 67 MB): the release keeps about 30 more threads ready, for explosions among others.
- With improved transparency on, 0.4 to 0.7 % of the pixels differ from v0.0.5 by one step out of 256 (rounding of the graphics card), invisible to the eye.
- Opening a world is as in v0.0.5: the world generator is still ready up to 22 ms later than in v0.0.4. Being looked into.