移除ci性能测试,github下不应该测试这些文件
This commit is contained in:
@@ -4,7 +4,7 @@ module.exports = {
|
||||
testEnvironment: 'node',
|
||||
roots: ['<rootDir>/tests'],
|
||||
testMatch: ['**/*.test.ts', '**/*.spec.ts'],
|
||||
testPathIgnorePatterns: ['/node_modules/', '\\.performance\\.test\\.ts$'],
|
||||
testPathIgnorePatterns: ['/node_modules/', '\\.performance\\.test\\.ts$', '/tests/performance/'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.ts',
|
||||
|
||||
28
packages/core/jest.performance.config.cjs
Normal file
28
packages/core/jest.performance.config.cjs
Normal file
@@ -0,0 +1,28 @@
|
||||
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
roots: ['<rootDir>/tests'],
|
||||
testMatch: ['**/performance/**/*.test.ts', '**/*.performance.test.ts'],
|
||||
collectCoverage: false,
|
||||
verbose: true,
|
||||
transform: {
|
||||
'^.+\\.tsx?$': ['ts-jest', {
|
||||
tsconfig: 'tsconfig.json',
|
||||
useESM: false,
|
||||
}],
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
||||
testTimeout: 30000,
|
||||
clearMocks: true,
|
||||
restoreMocks: true,
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/bin/',
|
||||
'<rootDir>/dist/',
|
||||
'<rootDir>/node_modules/'
|
||||
]
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component } from '../../../src/ECS/Component';
|
||||
import { ComponentStorage, ComponentStorageManager, EnableSoA } from '../../../src/ECS/Core/ComponentStorage';
|
||||
import { SoAStorage } from '../../../src/ECS/Core/SoAStorage';
|
||||
import { Component } from '../../src/ECS/Component';
|
||||
import { ComponentStorage, ComponentStorageManager, EnableSoA } from '../../src/ECS/Core/ComponentStorage';
|
||||
import { SoAStorage } from '../../src/ECS/Core/SoAStorage';
|
||||
|
||||
// 测试用统一组件结构(启用SoA)
|
||||
@EnableSoA
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EntityManager } from '../../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../../src/ECS/Utils/ComponentTypeManager';
|
||||
import { Entity } from '../../../src/ECS/Entity';
|
||||
import { EntityManager } from '../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../src/ECS/Utils/ComponentTypeManager';
|
||||
import { Entity } from '../../src/ECS/Entity';
|
||||
|
||||
describe('详细性能分析 - 逐步测量', () => {
|
||||
let entityManager: EntityManager;
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EntityManager } from '../../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../../src/ECS/Utils/ComponentTypeManager';
|
||||
import { EntityManager } from '../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../src/ECS/Utils/ComponentTypeManager';
|
||||
|
||||
describe('实体创建性能分析', () => {
|
||||
let entityManager: EntityManager;
|
||||
@@ -59,7 +59,7 @@ describe('实体创建性能分析', () => {
|
||||
const directEntities: any[] = [];
|
||||
for (let i = 0; i < entityCount; i++) {
|
||||
// 直接创建Entity,不通过EntityManager的复杂逻辑
|
||||
directEntities.push(new (require('../../../src/ECS/Entity').Entity)(`Direct_${i}`, i));
|
||||
directEntities.push(new (require('../../src/ECS/Entity').Entity)(`Direct_${i}`, i));
|
||||
}
|
||||
endTime = performance.now();
|
||||
console.log(`4. 直接创建Entity: ${(endTime - startTime).toFixed(2)}ms`);
|
||||
@@ -91,7 +91,7 @@ describe('实体创建性能分析', () => {
|
||||
|
||||
// 步骤2: Entity创建
|
||||
stepTime = performance.now();
|
||||
const entity = new (require('../../../src/ECS/Entity').Entity)(name, id);
|
||||
const entity = new (require('../../src/ECS/Entity').Entity)(name, id);
|
||||
stepTimes['Entity创建'] = (stepTimes['Entity创建'] || 0) + (performance.now() - stepTime);
|
||||
|
||||
// 步骤3: 各种索引更新
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Entity } from '../../../src/ECS/Entity';
|
||||
import { BigIntFactory } from '../../../src/ECS/Utils/BigIntCompatibility';
|
||||
import { ComponentType } from '../../../src/ECS/Core/ComponentStorage';
|
||||
import { Entity } from '../../src/ECS/Entity';
|
||||
import { BigIntFactory } from '../../src/ECS/Utils/BigIntCompatibility';
|
||||
import { ComponentType } from '../../src/ECS/Core/ComponentStorage';
|
||||
|
||||
describe('初始化方式性能对比', () => {
|
||||
test('对比不同初始化方式的性能', () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EntityManager } from '../../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../../src/ECS/Utils/ComponentTypeManager';
|
||||
import { Entity } from '../../../src/ECS/Entity';
|
||||
import { EntityManager } from '../../src/ECS/Core/EntityManager';
|
||||
import { ComponentTypeManager } from '../../src/ECS/Utils/ComponentTypeManager';
|
||||
import { Entity } from '../../src/ECS/Entity';
|
||||
|
||||
describe('优化后的性能分析 - ComponentIndexManager优化', () => {
|
||||
let entityManager: EntityManager;
|
||||
Reference in New Issue
Block a user