Face Maximum Elevations Optimization Benchmarks (v0.4.2)
Overview
This document records the performance benchmarks for the face maximum elevations optimization feature introduced in v0.4.2.
Test Environment
- Date: 2025-01-21
- Julia Version: (to be filled)
- Hardware: (to be filled)
- Test Models:
- Small:
ryugu_test.obj
(5,932 faces) - Large:
SHAPE_SFM_49k_v20180804.obj
(49,152 faces)
- Small:
Benchmark Scenario: Full Rotation (72 steps, 5° increments)
Sun positions generated for one complete asteroid rotation with the sun on the equatorial plane.
Small Model Results (5,932 faces)
- Total calculations: 427,104 illumination checks (5,932 × 72)
- Optimization effectiveness: 14.9%
Method | Time | Relative Speed |
---|---|---|
Pseudo-convex model | 848.0 μs | 1.0x (baseline) |
Self-shadowing (no opt) | 30.2 ms | 35.6x slower |
Self-shadowing (with opt) | 11.9 ms | 14.0x slower |
Speedup from optimization: 2.53x
Large Model Results (49,152 faces)
- Total calculations: 3,538,944 illumination checks (49,152 × 72)
- Optimization effectiveness: 10.7%
Method | Time | Relative Speed |
---|---|---|
Pseudo-convex model | 7.2 ms | 1.0x (baseline) |
Self-shadowing (no opt) | 1.08 s | 150x slower |
Self-shadowing (with opt) | 399.1 ms | 55.4x slower |
Speedup from optimization: 2.7x
Key Findings
- Correctness: All optimized results match exactly with non-optimized calculations
- Effectiveness: 10-15% of ray tracing calculations are skipped when sun is on equatorial plane
- Performance gain: 2.5-2.7x speedup despite relatively low skip rate
- Scalability: Optimization benefits scale well with model size
Implementation Details
The optimization works by:
- Pre-computing maximum elevation angles for each face
- Skipping ray tracing when sun elevation exceeds the maximum terrain elevation for that face
- This is most effective when the sun is at high elevations