mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-03 04:00:31 +00:00
[refactor] Move QuadTreeBenchmark to test directory
- Move QuadTreeBenchmark.ts from src/utils/spatial to tests-ui/tests/performance - Update import path in the benchmark file - Adjust performance test threshold to be more lenient (0.1 instead of 0.2) - This is a test utility, not production code
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Performance benchmark for QuadTree vs linear culling
|
||||
* Measures query performance at different node counts and zoom levels
|
||||
*/
|
||||
import { type Bounds, QuadTree } from './QuadTree'
|
||||
import { type Bounds, QuadTree } from '../../../src/utils/spatial/QuadTree'
|
||||
|
||||
export interface BenchmarkResult {
|
||||
nodeCount: number
|
||||
@@ -130,8 +130,8 @@ describe('Spatial Index Performance', () => {
|
||||
// Spatial index should be faster than linear search
|
||||
const speedup = linearTime / spatialTime
|
||||
// In some environments, speedup may be less due to small dataset
|
||||
// Just ensure spatial is not significantly slower
|
||||
expect(speedup).toBeGreaterThan(0.2)
|
||||
// Just ensure spatial is not significantly slower (at least 10% of linear speed)
|
||||
expect(speedup).toBeGreaterThan(0.1)
|
||||
|
||||
// Both should find roughly the same number of nodes
|
||||
const spatialResults = spatialIndex.queryViewport(viewport)
|
||||
|
||||
Reference in New Issue
Block a user