Skip to content

chore: instrument SF map Unity import with Stopwatch timing splits #260

Description

@nigel-hall-codes

Parent: #259 (techdesign) — see sdlc/#259/design.md, lever L0.

Why

Stage 2 (the Unity import in SFMapImporterWindow.cs) has no timing instrumentation — it logs only a chunk count (:169), never durations. Every hypothesis about what's slow (prefab serialization vs MeshCollider cooking vs parked-car instantiation vs mesh build) is currently a guess. This issue makes the import measurable so the profile-gated optimizations (#259 L3/L4) target the real bottleneck.

What

Add System.Diagnostics.Stopwatch splits to RunImport() / ImportChunk():

  • Total import time and per-chunk average
  • Per-operation splits: .bin read+parse (:185–215), TerrainData (:241), mesh build + RecalculateNormals (:573–589), MeshCollider cook (:322,:332,:341), parked-car instantiation (:384–429), SaveAsPrefabAsset (:153), final SaveAssets+Refresh (:167–168)
  • Log a summary over ~50–100 chunks (count, sum, mean, % of total per op)

Done when

Running the importer prints a per-operation timing breakdown that identifies the dominant cost(s).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions