From a5e70bcd992131e4bfcd920cf3bb3eef693dc467 Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 16:38:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8DQuerySystem=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=8E=A9=E7=A0=81=E7=B4=A2=E5=BC=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?toString()=E8=BF=94=E5=9B=9E[object=20Object]=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/QuerySystem.ts | 4 +- .../core/tests/ECS/Core/QuerySystem.test.ts | 56 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index 3e2b22d7..c432d26a 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -290,7 +290,7 @@ export class QuerySystem { const mask = entity.componentMask; // 组件掩码索引 - const maskKey = mask.toString(); + const maskKey = BitMask64Utils.toString(mask, 16); const maskSet = this.entityIndex.byMask.get(maskKey) || this.createAndSetMaskIndex(maskKey); maskSet.add(entity); @@ -348,7 +348,7 @@ export class QuerySystem { const mask = entity.componentMask; // 从组件掩码索引移除 - const maskKey = mask.toString(); + const maskKey = BitMask64Utils.toString(mask, 16); const maskSet = this.entityIndex.byMask.get(maskKey); if (maskSet) { maskSet.delete(entity); diff --git a/packages/core/tests/ECS/Core/QuerySystem.test.ts b/packages/core/tests/ECS/Core/QuerySystem.test.ts index ca5950a4..6e94b2fd 100644 --- a/packages/core/tests/ECS/Core/QuerySystem.test.ts +++ b/packages/core/tests/ECS/Core/QuerySystem.test.ts @@ -1049,4 +1049,60 @@ describe('QuerySystem - 查询系统测试', () => { } }); }); + + describe('组件掩码字符串索引', () => { + test('应该为不同的组件组合生成不同的掩码字符串', () => { + // 创建具有不同组件组合的实体 + const entity1 = new Entity('Entity1', 101); + const entity2 = new Entity('Entity2', 102); + const entity3 = new Entity('Entity3', 103); + + entity1.addComponent(new PositionComponent(1, 1)); + entity2.addComponent(new VelocityComponent(2, 2)); + entity3.addComponent(new PositionComponent(3, 3)); + entity3.addComponent(new VelocityComponent(4, 4)); + + const allEntities = [...entities, entity1, entity2, entity3]; + querySystem.setEntities(allEntities); + + // 查询包含指定组件的实体(queryAll 是包含关系,不是仅有) + const withPosition = querySystem.queryAll(PositionComponent); + const withVelocity = querySystem.queryAll(VelocityComponent); + const withBoth = querySystem.queryAll(PositionComponent, VelocityComponent); + + // entity1 应该在 withPosition 中 + expect(withPosition.entities.some(e => e.id === 101)).toBe(true); + // entity2 应该在 withVelocity 中 + expect(withVelocity.entities.some(e => e.id === 102)).toBe(true); + // entity3 应该在所有查询中(因为它包含 Position 和 Velocity) + expect(withPosition.entities.some(e => e.id === 103)).toBe(true); + expect(withVelocity.entities.some(e => e.id === 103)).toBe(true); + expect(withBoth.entities.some(e => e.id === 103)).toBe(true); + + // withBoth 只应该包含同时有两个组件的实体 + expect(withBoth.entities.some(e => e.id === 101)).toBe(false); // 只有 Position + expect(withBoth.entities.some(e => e.id === 102)).toBe(false); // 只有 Velocity + }); + + test('相同组件组合的实体应该使用相同的掩码索引', () => { + const entity1 = new Entity('Entity1', 201); + const entity2 = new Entity('Entity2', 202); + + // 两个实体都有相同的组件组合 + entity1.addComponent(new PositionComponent(1, 1)); + entity1.addComponent(new VelocityComponent(2, 2)); + + entity2.addComponent(new PositionComponent(3, 3)); + entity2.addComponent(new VelocityComponent(4, 4)); + + const allEntities = [...entities, entity1, entity2]; + querySystem.setEntities(allEntities); + + // 查询应该同时返回这两个实体 + const result = querySystem.queryAll(PositionComponent, VelocityComponent); + + expect(result.entities.some(e => e.id === 201)).toBe(true); + expect(result.entities.some(e => e.id === 202)).toBe(true); + }); + }); }); \ No newline at end of file From 1ac0227c90d73960a829375c72e899a6044cdbbd Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 17:01:49 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=A7=BB=E9=99=A4bymask?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/ArchetypeSystem.ts | 20 +++++++++++- packages/core/src/ECS/Core/QuerySystem.ts | 32 +------------------ 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/packages/core/src/ECS/Core/ArchetypeSystem.ts b/packages/core/src/ECS/Core/ArchetypeSystem.ts index ebae1aac..68a3fd66 100644 --- a/packages/core/src/ECS/Core/ArchetypeSystem.ts +++ b/packages/core/src/ECS/Core/ArchetypeSystem.ts @@ -186,7 +186,25 @@ export class ArchetypeSystem { public getAllArchetypes(): Archetype[] { return this._allArchetypes.slice(); } - + + /** + * 获取包含指定组件类型的所有实体 + */ + public getEntitiesByComponent(componentType: ComponentType): Entity[] { + const archetypes = this._componentToArchetypes.get(componentType); + if (!archetypes || archetypes.size === 0) { + return []; + } + + const entities: Entity[] = []; + for (const archetype of archetypes) { + for (const entity of archetype.entities) { + entities.push(entity); + } + } + return entities; + } + /** * 清空所有数据 */ diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index c432d26a..2a49e9ea 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -46,7 +46,6 @@ export interface QueryResult { * 实体索引结构 */ interface EntityIndex { - byMask: Map>; byComponentType: Map>; byTag: Map>; byName: Map>; @@ -106,7 +105,6 @@ export class QuerySystem { constructor() { this.entityIndex = { - byMask: new Map(), byComponentType: new Map(), byTag: new Map(), byName: new Map() @@ -287,13 +285,6 @@ export class QuerySystem { * 将实体添加到各种索引中 */ private addEntityToIndexes(entity: Entity): void { - const mask = entity.componentMask; - - // 组件掩码索引 - const maskKey = BitMask64Utils.toString(mask, 16); - const maskSet = this.entityIndex.byMask.get(maskKey) || this.createAndSetMaskIndex(maskKey); - maskSet.add(entity); - // 组件类型索引 - 批量处理,预获取所有相关的Set const components = entity.components; for (let i = 0; i < components.length; i++) { @@ -317,12 +308,6 @@ export class QuerySystem { } } - private createAndSetMaskIndex(maskKey: string): Set { - const set = new Set(); - this.entityIndex.byMask.set(maskKey, set); - return set; - } - private createAndSetComponentIndex(componentType: ComponentType): Set { const set = new Set(); this.entityIndex.byComponentType.set(componentType, set); @@ -345,18 +330,6 @@ export class QuerySystem { * 从各种索引中移除实体 */ private removeEntityFromIndexes(entity: Entity): void { - const mask = entity.componentMask; - - // 从组件掩码索引移除 - const maskKey = BitMask64Utils.toString(mask, 16); - const maskSet = this.entityIndex.byMask.get(maskKey); - if (maskSet) { - maskSet.delete(entity); - if (maskSet.size === 0) { - this.entityIndex.byMask.delete(maskKey); - } - } - // 从组件类型索引移除 for (const component of entity.components) { const componentType = component.constructor as ComponentType; @@ -394,12 +367,11 @@ export class QuerySystem { /** * 重建所有索引 - * + * * 清空并重新构建所有查询索引。 * 通常在大量实体变更后调用以确保索引一致性。 */ private rebuildIndexes(): void { - this.entityIndex.byMask.clear(); this.entityIndex.byComponentType.clear(); this.entityIndex.byTag.clear(); this.entityIndex.byName.clear(); @@ -954,7 +926,6 @@ export class QuerySystem { public getStats(): { entityCount: number; indexStats: { - maskIndexSize: number; componentIndexSize: number; tagIndexSize: number; nameIndexSize: number; @@ -980,7 +951,6 @@ export class QuerySystem { return { entityCount: this.entities.length, indexStats: { - maskIndexSize: this.entityIndex.byMask.size, componentIndexSize: this.entityIndex.byComponentType.size, tagIndexSize: this.entityIndex.byTag.size, nameIndexSize: this.entityIndex.byName.size From d542ac48b8971dde971efb2e42ccb7035ec820e1 Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 17:07:13 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=87=8D=E6=9E=84byComponentType=E4=B8=BAl?= =?UTF-8?q?azy=20cache=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/QuerySystem.ts | 42 +++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index 2a49e9ea..92437144 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -285,12 +285,12 @@ export class QuerySystem { * 将实体添加到各种索引中 */ private addEntityToIndexes(entity: Entity): void { - // 组件类型索引 - 批量处理,预获取所有相关的Set + // 组件类型索引改为lazy cache,这里只清除相关缓存 const components = entity.components; for (let i = 0; i < components.length; i++) { const componentType = components[i].constructor as ComponentType; - const typeSet = this.entityIndex.byComponentType.get(componentType) || this.createAndSetComponentIndex(componentType); - typeSet.add(entity); + // 清除该组件类型的缓存,下次查询时会重新构建 + this.entityIndex.byComponentType.delete(componentType); } // 标签索引 @@ -308,9 +308,20 @@ export class QuerySystem { } } - private createAndSetComponentIndex(componentType: ComponentType): Set { - const set = new Set(); - this.entityIndex.byComponentType.set(componentType, set); + /** + * Lazy获取组件类型索引,不存在时从ArchetypeSystem构建 + */ + private getComponentTypeIndex(componentType: ComponentType): Set { + let set = this.entityIndex.byComponentType.get(componentType); + if (!set) { + // 从ArchetypeSystem构建 + set = new Set(); + const entities = this.archetypeSystem.getEntitiesByComponent(componentType); + for (const entity of entities) { + set.add(entity); + } + this.entityIndex.byComponentType.set(componentType, set); + } return set; } @@ -330,16 +341,11 @@ export class QuerySystem { * 从各种索引中移除实体 */ private removeEntityFromIndexes(entity: Entity): void { - // 从组件类型索引移除 + // 组件类型索引改为lazy cache,这里只清除相关缓存 for (const component of entity.components) { const componentType = component.constructor as ComponentType; - const typeSet = this.entityIndex.byComponentType.get(componentType); - if (typeSet) { - typeSet.delete(entity); - if (typeSet.size === 0) { - this.entityIndex.byComponentType.delete(componentType); - } - } + // 清除该组件类型的缓存,下次查询时会重新构建 + this.entityIndex.byComponentType.delete(componentType); } // 从标签索引移除 @@ -470,8 +476,8 @@ export class QuerySystem { let smallestSize = Infinity; for (const componentType of componentTypes) { - const set = this.entityIndex.byComponentType.get(componentType); - if (!set || set.size === 0) { + const set = this.getComponentTypeIndex(componentType); + if (set.size === 0) { return []; // 如果任何组件没有实体,直接返回空结果 } if (set.size < smallestSize) { @@ -735,9 +741,9 @@ export class QuerySystem { }; } - // 使用索引查询 + // 使用索引查询(lazy构建) this.queryStats.indexHits++; - const entities = Array.from(this.entityIndex.byComponentType.get(componentType) || []); + const entities = Array.from(this.getComponentTypeIndex(componentType)); // 缓存结果 this.addToCache(cacheKey, entities); From 125a1686aba65fe743d891d253bef43459b8bef8 Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 17:54:22 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=AE=8C=E5=85=A8=E5=88=A0=E9=99=A4=20byCo?= =?UTF-8?q?mponentType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/QuerySystem.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index 92437144..dd7acd08 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -285,14 +285,6 @@ export class QuerySystem { * 将实体添加到各种索引中 */ private addEntityToIndexes(entity: Entity): void { - // 组件类型索引改为lazy cache,这里只清除相关缓存 - const components = entity.components; - for (let i = 0; i < components.length; i++) { - const componentType = components[i].constructor as ComponentType; - // 清除该组件类型的缓存,下次查询时会重新构建 - this.entityIndex.byComponentType.delete(componentType); - } - // 标签索引 const tag = entity.tag; if (tag !== undefined) { @@ -341,13 +333,6 @@ export class QuerySystem { * 从各种索引中移除实体 */ private removeEntityFromIndexes(entity: Entity): void { - // 组件类型索引改为lazy cache,这里只清除相关缓存 - for (const component of entity.components) { - const componentType = component.constructor as ComponentType; - // 清除该组件类型的缓存,下次查询时会重新构建 - this.entityIndex.byComponentType.delete(componentType); - } - // 从标签索引移除 if (entity.tag !== undefined) { const tagSet = this.entityIndex.byTag.get(entity.tag); From 78047134c2aa619bae2fbee1f14991d74c50179f Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 18:03:03 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=AE=8C=E5=85=A8=E7=A7=BB=E9=99=A4=20byCo?= =?UTF-8?q?mponentType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/QuerySystem.ts | 52 +++-------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index dd7acd08..1bdf5c86 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -46,7 +46,6 @@ export interface QueryResult { * 实体索引结构 */ interface EntityIndex { - byComponentType: Map>; byTag: Map>; byName: Map>; } @@ -105,7 +104,6 @@ export class QuerySystem { constructor() { this.entityIndex = { - byComponentType: new Map(), byTag: new Map(), byName: new Map() }; @@ -300,22 +298,6 @@ export class QuerySystem { } } - /** - * Lazy获取组件类型索引,不存在时从ArchetypeSystem构建 - */ - private getComponentTypeIndex(componentType: ComponentType): Set { - let set = this.entityIndex.byComponentType.get(componentType); - if (!set) { - // 从ArchetypeSystem构建 - set = new Set(); - const entities = this.archetypeSystem.getEntitiesByComponent(componentType); - for (const entity of entities) { - set.add(entity); - } - this.entityIndex.byComponentType.set(componentType, set); - } - return set; - } private createAndSetTagIndex(tag: number): Set { const set = new Set(); @@ -363,10 +345,9 @@ export class QuerySystem { * 通常在大量实体变更后调用以确保索引一致性。 */ private rebuildIndexes(): void { - this.entityIndex.byComponentType.clear(); this.entityIndex.byTag.clear(); this.entityIndex.byName.clear(); - + // 清理ArchetypeSystem和ComponentIndexManager this.archetypeSystem.clear(); this.componentIndexManager.clear(); @@ -456,31 +437,11 @@ export class QuerySystem { * @returns 匹配的实体列表 */ private queryMultipleComponents(componentTypes: ComponentType[]): Entity[] { - // 找到最小的组件集合作为起点 - let smallestSet: Set | null = null; - let smallestSize = Infinity; - - for (const componentType of componentTypes) { - const set = this.getComponentTypeIndex(componentType); - if (set.size === 0) { - return []; // 如果任何组件没有实体,直接返回空结果 - } - if (set.size < smallestSize) { - smallestSize = set.size; - smallestSet = set; - } - } - - if (!smallestSet) { - return []; // 如果没有找到任何组件集合,返回空结果 - } - - // 从最小集合开始,逐步过滤 - const mask = this.createComponentMask(componentTypes); + const archetypeResult = this.archetypeSystem.queryArchetypes(componentTypes, 'AND'); const result: Entity[] = []; - for (const entity of smallestSet) { - if (BitMask64Utils.hasAll(entity.componentMask, mask)) { + for (const archetype of archetypeResult.archetypes) { + for (const entity of archetype.entities) { result.push(entity); } } @@ -726,9 +687,8 @@ export class QuerySystem { }; } - // 使用索引查询(lazy构建) this.queryStats.indexHits++; - const entities = Array.from(this.getComponentTypeIndex(componentType)); + const entities = this.archetypeSystem.getEntitiesByComponent(componentType); // 缓存结果 this.addToCache(cacheKey, entities); @@ -942,7 +902,7 @@ export class QuerySystem { return { entityCount: this.entities.length, indexStats: { - componentIndexSize: this.entityIndex.byComponentType.size, + componentIndexSize: this.archetypeSystem.getAllArchetypes().length, tagIndexSize: this.entityIndex.byTag.size, nameIndexSize: this.entityIndex.byName.size }, From 86e2dc8fdbe6eb684a8c538b998040df1e27d81a Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Tue, 30 Sep 2025 18:12:49 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AE=8C=E5=85=A8=E5=88=A0=E9=99=A4=20Comp?= =?UTF-8?q?onentIndexManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/ECS/Core/QuerySystem.ts | 56 +++++------------------ 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/packages/core/src/ECS/Core/QuerySystem.ts b/packages/core/src/ECS/Core/QuerySystem.ts index 1bdf5c86..1940647c 100644 --- a/packages/core/src/ECS/Core/QuerySystem.ts +++ b/packages/core/src/ECS/Core/QuerySystem.ts @@ -6,7 +6,6 @@ import { createLogger } from '../../Utils/Logger'; import { getComponentTypeName } from '../Decorators'; import { ComponentPoolManager } from './ComponentPool'; -import { ComponentIndexManager } from './ComponentIndex'; import { ArchetypeSystem, Archetype, ArchetypeQueryResult } from './ArchetypeSystem'; /** @@ -89,7 +88,6 @@ export class QuerySystem { private componentMaskCache = new Map(); - private componentIndexManager: ComponentIndexManager; private archetypeSystem: ArchetypeSystem; // 性能统计 @@ -108,8 +106,6 @@ export class QuerySystem { byName: new Map() }; - // 初始化新的性能优化系统 - this.componentIndexManager = new ComponentIndexManager(); this.archetypeSystem = new ArchetypeSystem(); } @@ -143,7 +139,6 @@ export class QuerySystem { this.entities.push(entity); this.addEntityToIndexes(entity); - this.componentIndexManager.addEntity(entity); this.archetypeSystem.addEntity(entity); @@ -178,7 +173,6 @@ export class QuerySystem { this.addEntityToIndexes(entity); // 更新索引管理器 - this.componentIndexManager.addEntity(entity); this.archetypeSystem.addEntity(entity); existingIds.add(entity.id); @@ -213,7 +207,6 @@ export class QuerySystem { this.addEntityToIndexes(entity); // 更新索引管理器 - this.componentIndexManager.addEntity(entity); this.archetypeSystem.addEntity(entity); } @@ -234,7 +227,6 @@ export class QuerySystem { this.entities.splice(index, 1); this.removeEntityFromIndexes(entity); - this.componentIndexManager.removeEntity(entity); this.archetypeSystem.removeEntity(entity); this.clearQueryCache(); @@ -264,11 +256,6 @@ export class QuerySystem { // 更新ArchetypeSystem中的实体状态 this.archetypeSystem.updateEntity(entity); - - // 更新ComponentIndexManager中的实体状态 - this.componentIndexManager.removeEntity(entity); - this.componentIndexManager.addEntity(entity); - // 重新添加实体到索引(基于新的组件状态) this.addEntityToIndexes(entity); @@ -350,11 +337,9 @@ export class QuerySystem { // 清理ArchetypeSystem和ComponentIndexManager this.archetypeSystem.clear(); - this.componentIndexManager.clear(); for (const entity of this.entities) { this.addEntityToIndexes(entity); - this.componentIndexManager.addEntity(entity); this.archetypeSystem.addEntity(entity); } } @@ -394,26 +379,13 @@ export class QuerySystem { }; } - let entities: Entity[] = []; - + this.queryStats.archetypeHits++; const archetypeResult = this.archetypeSystem.queryArchetypes(componentTypes, 'AND'); - if (archetypeResult.archetypes.length > 0) { - this.queryStats.archetypeHits++; - for (const archetype of archetypeResult.archetypes) { - entities.push(...archetype.entities); - } - } else { - try { - if (componentTypes.length === 1) { - this.queryStats.indexHits++; - const indexResult = this.componentIndexManager.query(componentTypes[0]); - entities = Array.from(indexResult); - } else { - const indexResult = this.componentIndexManager.queryMultiple(componentTypes, 'AND'); - entities = Array.from(indexResult); - } - } catch (error) { - entities = []; + + const entities: Entity[] = []; + for (const archetype of archetypeResult.archetypes) { + for (const entity of archetype.entities) { + entities.push(entity); } } @@ -485,18 +457,14 @@ export class QuerySystem { }; } + this.queryStats.archetypeHits++; const archetypeResult = this.archetypeSystem.queryArchetypes(componentTypes, 'OR'); - let entities: Entity[]; - if (archetypeResult.archetypes.length > 0) { - this.queryStats.archetypeHits++; - entities = []; - for (const archetype of archetypeResult.archetypes) { - entities.push(...archetype.entities); + const entities: Entity[] = []; + for (const archetype of archetypeResult.archetypes) { + for (const entity of archetype.entities) { + entities.push(entity); } - } else { - const indexResult = this.componentIndexManager.queryMultiple(componentTypes, 'OR'); - entities = Array.from(indexResult); } this.addToCache(cacheKey, entities); @@ -891,7 +859,6 @@ export class QuerySystem { cacheHitRate: string; }; optimizationStats: { - componentIndex: any; archetypeSystem: any; }; cacheStats: { @@ -912,7 +879,6 @@ export class QuerySystem { (this.queryStats.cacheHits / this.queryStats.totalQueries * 100).toFixed(2) + '%' : '0%' }, optimizationStats: { - componentIndex: this.componentIndexManager.getStats(), archetypeSystem: this.archetypeSystem.getAllArchetypes().map(a => ({ id: a.id, componentTypes: a.componentTypes.map(t => getComponentTypeName(t)),