diff --git a/encompass-cs/Collections/ComponentStore.cs b/encompass-cs/Collections/ComponentStore.cs index b081f99..60396ea 100644 --- a/encompass-cs/Collections/ComponentStore.cs +++ b/encompass-cs/Collections/ComponentStore.cs @@ -6,7 +6,7 @@ namespace Encompass { internal class ComponentStore { - private Dictionary Stores = new Dictionary(); + private Dictionary Stores = new Dictionary(512); public IEnumerable<(Type, TypedComponentStore)> StoresEnumerable() { diff --git a/encompass-cs/Collections/TypedComponentStore.cs b/encompass-cs/Collections/TypedComponentStore.cs index 6392739..cb84a6d 100644 --- a/encompass-cs/Collections/TypedComponentStore.cs +++ b/encompass-cs/Collections/TypedComponentStore.cs @@ -15,8 +15,8 @@ namespace Encompass internal class TypedComponentStore : TypedComponentStore where TComponent : struct, IComponent { - private readonly Dictionary store = new Dictionary(); - private readonly Dictionary priorities = new Dictionary(); + private readonly Dictionary store = new Dictionary(128); + private readonly Dictionary priorities = new Dictionary(128); public override int Count { get => store.Count; } diff --git a/encompass-cs/ComponentMessageManager.cs b/encompass-cs/ComponentMessageManager.cs index 9c37d0b..2d93a1a 100644 --- a/encompass-cs/ComponentMessageManager.cs +++ b/encompass-cs/ComponentMessageManager.cs @@ -13,7 +13,7 @@ namespace Encompass private readonly ComponentStore pendingComponentStore = new ComponentStore(); private ComponentStore upToDateComponentStore = new ComponentStore(); - private readonly Dictionary> typeToEntityToPendingComponentPriority = new Dictionary>(); + private readonly Dictionary> typeToEntityToPendingComponentPriority = new Dictionary>(128); public ComponentStore UpToDateComponentStore { get => upToDateComponentStore; } diff --git a/encompass-cs/DrawLayerManager.cs b/encompass-cs/DrawLayerManager.cs index c116bb7..9785987 100644 --- a/encompass-cs/DrawLayerManager.cs +++ b/encompass-cs/DrawLayerManager.cs @@ -8,10 +8,10 @@ namespace Encompass { private readonly SortedList layerOrder = new SortedList(); - private readonly Dictionary layerIndexToComponentStore = new Dictionary(); - private readonly Dictionary> layerIndexToGeneralRenderers = new Dictionary>(); + private readonly Dictionary layerIndexToComponentStore = new Dictionary(512); + private readonly Dictionary> layerIndexToGeneralRenderers = new Dictionary>(512); - private readonly Dictionary> typeToEntityToLayer = new Dictionary>(); + private readonly Dictionary> typeToEntityToLayer = new Dictionary>(512); public IEnumerable LayerOrder { get { return layerOrder.Values; } } diff --git a/encompass-cs/EntityManager.cs b/encompass-cs/EntityManager.cs index fa96910..2d33f31 100644 --- a/encompass-cs/EntityManager.cs +++ b/encompass-cs/EntityManager.cs @@ -7,9 +7,9 @@ namespace Encompass { internal class EntityManager { - private readonly Dictionary IDToEntity = new Dictionary(); + private readonly Dictionary IDToEntity = new Dictionary(1024); - private readonly HashSet entitiesMarkedForDestroy = new HashSet(); + private readonly HashSet entitiesMarkedForDestroy = new HashSet(256); private readonly ComponentManager componentManager; diff --git a/encompass-cs/RenderManager.cs b/encompass-cs/RenderManager.cs index 07d4a46..bb271e9 100644 --- a/encompass-cs/RenderManager.cs +++ b/encompass-cs/RenderManager.cs @@ -10,7 +10,7 @@ namespace Encompass private readonly DrawLayerManager drawLayerManager; private readonly EntityManager entityManager; - private readonly Dictionary> drawComponentTypeToOrderedRenderer = new Dictionary>(); + private readonly Dictionary> drawComponentTypeToOrderedRenderer = new Dictionary>(256); public RenderManager( ComponentManager componentManager,