Skip to content

Conversation

@octylFractal
Copy link
Member

@octylFractal octylFractal commented Jan 4, 2026

This uses a single array combined with efficiently computed indexes to avoid needing to do entire map equality comparisons or hold large hash-based tables, improving memory and CPU usage.

# master with obj2obj maps to fix a bug
Benchmark 1: java -jar fabric-server-mc.1.21.11-loader.0.18.4-launcher.1.1.1.jar --nogui
  Time (mean ± σ):      6.781 s ±  0.128 s    [User: 33.699 s, System: 1.062 s]
  Range (min … max):    6.567 s …  7.017 s    10 runs
# my changes
Benchmark 1: java -jar fabric-server-mc.1.21.11-loader.0.18.4-launcher.1.1.1.jar --nogui
  Time (mean ± σ):      6.464 s ±  0.045 s    [User: 32.450 s, System: 1.104 s]
  Range (min … max):    6.399 s …  6.529 s    10 runs

master with obj2obj maps:
heap dump with BlockType retaining 2,097,040 bytes

my changes:
heap dump with BlockType retaining 1,217,728 bytes

@octylFractal octylFractal added this to the 7.4.0 milestone Jan 4, 2026
@octylFractal octylFractal self-assigned this Jan 4, 2026
@octylFractal octylFractal requested a review from a team as a code owner January 4, 2026 09:29
@octylFractal octylFractal added the type:performance Performance-related issue label Jan 4, 2026
@octylFractal octylFractal force-pushed the perf/blockstates-round-two branch 2 times, most recently from fb2dfc3 to ebc6643 Compare January 4, 2026 09:32
@octylFractal octylFractal requested a review from me4502 January 5, 2026 00:13
@octylFractal octylFractal enabled auto-merge January 5, 2026 00:13
This uses a single array combined with efficiently computed indexes to
avoid needing to do entire map equality comparisons or hold large
hash-based tables, improving memory and CPU usage.
@octylFractal octylFractal force-pushed the perf/blockstates-round-two branch from f326551 to 0e3c050 Compare January 5, 2026 01:02
@octylFractal octylFractal added this pull request to the merge queue Jan 5, 2026
Merged via the queue into master with commit 2966134 Jan 5, 2026
5 checks passed
@octylFractal octylFractal deleted the perf/blockstates-round-two branch January 5, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:performance Performance-related issue

Development

Successfully merging this pull request may close these issues.

3 participants