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)

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%
MethodTimeRelative Speed
Pseudo-convex model848.0 μs1.0x (baseline)
Self-shadowing (no opt)30.2 ms35.6x slower
Self-shadowing (with opt)11.9 ms14.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%
MethodTimeRelative Speed
Pseudo-convex model7.2 ms1.0x (baseline)
Self-shadowing (no opt)1.08 s150x slower
Self-shadowing (with opt)399.1 ms55.4x slower

Speedup from optimization: 2.7x

Key Findings

  1. Correctness: All optimized results match exactly with non-optimized calculations
  2. Effectiveness: 10-15% of ray tracing calculations are skipped when sun is on equatorial plane
  3. Performance gain: 2.5-2.7x speedup despite relatively low skip rate
  4. Scalability: Optimization benefits scale well with model size

Implementation Details

The optimization works by:

  1. Pre-computing maximum elevation angles for each face
  2. Skipping ray tracing when sun elevation exceeds the maximum terrain elevation for that face
  3. This is most effective when the sun is at high elevations