askill
performance-at-scale

performance-at-scaleSafety 95Repository

Spatial indexing and world streaming for Three.js building games with thousands of pieces. Use when optimizing building games, implementing spatial queries, chunk loading, or profiling performance. Includes spatial hash grids, octrees, chunk managers, and benchmarking tools.

6 stars
1.2k downloads
Updated 2/16/2026

Package Files

Loading files...
SKILL.md

Performance at Scale

Spatial indexing and world streaming for large-scale building systems.

Quick Start

import { SpatialHashGrid } from './scripts/spatial-hash-grid.js';
import { Octree } from './scripts/octree.js';

// Uniform distribution - use hash grid
const grid = new SpatialHashGrid(10);
grid.insert(piece, piece.position);
const nearby = grid.queryRadius(position, 15);

// Clustered bases - use octree
const octree = new Octree(bounds, { maxDepth: 8 });
octree.insert(piece);
const inBox = octree.queryBox(min, max);

Reference

See references/performance-at-scale.md for detailed guidance on:

  • Spatial partitioning selection (when to use grid vs octree)
  • Chunk loading strategies
  • Instancing and LOD
  • Memory management

Scripts

  • scripts/spatial-hash-grid.js - O(1) queries for uniform distribution
  • scripts/octree.js - Adaptive queries for clustered objects
  • scripts/chunk-manager.js - World streaming for large maps
  • scripts/performance-profiler.js - Benchmarking utilities

Selection Guide

PiecesDistributionUse
<1,000AnyArray
1-5kUniformSpatialHashGrid
1-5kClusteredOctree
5k+AnyChunkManager + Octree per chunk

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

74/100Analyzed 2/25/2026

Solid technical skill for Three.js spatial indexing with good code examples and a selection guide. Includes useful reference table for choosing between spatial hash grids and octrees. Slightly lacks step-by-step guidance and tags, but provides practical reusable patterns. Located in proper skills folder with technical reference content, earning bonus points.

95
78
75
70
65

Metadata

Licenseunknown
Version-
Updated2/16/2026
PublisherBbeierle12

Tags

No tags yet.