Skip to content

Commit

Permalink
Reduce load factor of ForgeRegistry delegate map
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Mar 1, 2024
1 parent a1ece7d commit 1241122
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.embeddedt.modernfix.forge.mixin.perf.forge_registry_alloc;

import it.unimi.dsi.fastutil.Hash;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import net.minecraft.core.Holder;
import net.minecraft.resources.ResourceKey;
Expand All @@ -19,7 +20,7 @@ public abstract class ForgeRegistryMixin<V> {
// are a bottleneck in many areas (e.g. render type lookup)
@Shadow @Final private Map<ResourceLocation, Holder.Reference<V>> delegatesByName = new Object2ObjectOpenHashMap<>();

@Shadow @Final private Map<V, Holder.Reference<V>> delegatesByValue = new Object2ObjectOpenHashMap<>();
@Shadow @Final private Map<V, Holder.Reference<V>> delegatesByValue = new Object2ObjectOpenHashMap<>(Hash.DEFAULT_INITIAL_SIZE, 0.5F);

/**
* @author embeddedt
Expand Down

0 comments on commit 1241122

Please sign in to comment.