Repository navigation
Load Test Baseline
Audience: Programmers | Mixed
Thread Context: N/A (audit/reference) — load test exercises the full multi-threaded engine (Physics, JobSystem, EventBus, ECS)
Platform/Backend Scope: Linux x86_64, GCC Release, NullRHI (headless) — numbers are platform-specific
Baseline performance numbers from a full engine load test. These serve as regression benchmarks — future runs should compare against them to catch performance regressions before they ship. The baseline below was captured 2026-03-26 on Linux x86_64 / GCC Release. The test harness (Tests/TestEngineLoadTest.cpp, 1,716 lines) and all of its scenarios are confirmed present as of 2026-06-08; baseline numbers should be re-captured on a controlled machine before being treated as a hard gate.
The load test lives in Tests/TestEngineLoadTest.cpp. It:
-
Initializes the full engine (25+ subsystems via
InitLoadTestEngine()). -
Runs 3,000 heavy frames, each exercising: physics stepping, weather transitions (every 120 frames), TimeOfDay advancement, coroutine scheduling, tween updates, ability ticking, instance manager updates, 20 entity create/destroy cycles (Transform + HealthComponent), EventBus publish (1 event/frame, 10 subscribers), a NullRHI frame cycle with periodic resource creation, GPU perf-counter tracking (50 draw calls + 5,000 primitives/frame), a profiler frame cycle, and a JobSystem
ParallelFor(500 items every 10 frames). -
Samples OS resources every 50 frames via
/proc/self/status+getrusage(). - Reports frame-timing percentiles, CPU user/system/total, and memory RSS/VSZ.
LoadTest_FullEngine_3000Frames, LoadTest_Adverse_HighEntityCount, LoadTest_Adverse_ThreadContention, LoadTest_Adverse_StateThrashing, LoadTest_Severe_EntityFlood, LoadTest_Severe_EventBusStorm, LoadTest_Severe_JobSystemFlood (plus save/load and network-churn scenarios described below).
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build --config Release --parallel $(nproc)
# Just the load test output:
./build/bin/SparkTests 2>&1 | grep -A 50 "FULL ENGINE LOAD TEST"| Metric | Value |
|---|---|
| Min | 3.5 us |
| Avg | 8.7 us |
| P50 | 3.8 us |
| P95 | 38.7 us |
| P99 | 62.5 us |
| Max | 141.9 us |
| Total (3000 frames) | 27.0 ms |
| Effective FPS | 110,978 |
| Spikes (>3x avg) | 305 |
| Spikes (>10x avg) | 12 |
| Metric | Value |
|---|---|
| User time | 20.0 ms |
| System time | 13.2 ms |
| Total CPU | 33.2 ms |
| Utilization | 122.8% (multi-threaded) |
| Metric | Value |
|---|---|
| Min | 35.1 MB |
| Avg | 35.2 MB |
| Max | 35.2 MB |
| Growth | 20 KB |
| VSZ Max | 1165.9 MB |
| Metric | Value |
|---|---|
| Entities created/destroyed | 60,000 |
| EventBus events delivered | 3,000 |
| ParallelFor batches | 300 (150,000 work items) |
| Weather transitions | 26 |
If a future run shows any of these, investigate before merging:
- Avg frame time > 50 us (baseline 8.7 us — 5.7x headroom)
- P99 frame time > 500 us (baseline 62.5 us — 8x headroom)
- RSS growth > 1 MB over 3,000 frames (baseline 20 KB)
- RSS peak > 50 MB (baseline 35.2 MB)
- CPU utilization < 100% would indicate JobSystem threads aren't being used
- Events delivered != frame count would indicate an EventBus type mismatch or subscription leak
| Metric | Value |
|---|---|
| Create 10k (Transform + Health + Light) | 49.1 ms |
| Destroy 10k | 24.9 ms |
| Frame avg while 10k alive (100 frames) | 0.6 us |
| RSS after create / destroy | 37.0 MB / 37.0 MB |
| Metric | Value |
|---|---|
| Jobs completed | 10,000/10,000 |
| Batch avg / min / max | 400 us / 320 us / 629 us |
| Metric | Value |
|---|---|
| Frame avg (2000 frames) / max | 0.4 us / 6.0 us |
| Memory delta | 0 KB |
| Metric | Value |
|---|---|
| Create 100k (Transform only) | 1,944 ms (19.4 us/entity) |
| Destroy 100k | 2,341 ms (23.4 us/entity) |
| RSS before / peak / after | 37.0 MB / 46.7 MB / 46.7 MB (pools retained) |
| Metric | Value |
|---|---|
| Total deliveries | 5,000,000 / 5,000,000 |
| Total time | 78.1 ms |
| Throughput | 64 million deliveries/sec |
| Metric | Value |
|---|---|
| Completed | 10,000 / 10,000 |
| Total time / per job | 20.3 ms / 2.03 us |
| Throughput | 493k jobs/sec |
| Metric | Value |
|---|---|
| Save avg / max | 766 us / 1,142 us |
| Load avg / max | 530 us / 842 us |
| Network cycles successful | 50/50 (2.6 ms total, 52 us/cycle) |
- The
>10x avgspikes (12 of 3,000) are JobSystem thread wake-up latency on the firstParallelFordispatch of a batch — expected OS scheduling behavior. - RSS stays flat because per-frame entity churn reuses EnTT's recycled entity slots and component pools; the 20 KB growth is likely allocator metadata.
- CPU utilization > 100% confirms the 4-thread JobSystem is doing real parallel work.
- NullRHI adds no overhead — it only tracks counters, never touching a GPU.
-
Original baseline:
.claude/knowledge/load-test-baseline.md, dated 2026-03-26. - Re-measured against codebase 2026-06-08 (harness presence verified; baseline numbers carried forward, not re-run).
- OLD → NEW notes:
-
Tests/TestEngineLoadTest.cppconfirmed present and is now 1,716 lines. - All listed scenarios verified present in the current file (full-engine, adverse, severe, save/load, network churn).
- Frame-timing, CPU, memory, and stress numbers are unchanged from the 2026-03-26 capture — they are hardware-specific and should be re-captured on a controlled machine before being enforced as a CI gate.
-
- Findings now resolved/changed: none — the test exists and matches its documented structure.
Published from 2b03dc797148. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Platform Certification
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers