Factory App
A conveyor-belt performance sandbox. I built a deliberately wasteful spawn-and-destroy baseline, then a prewarmed object pool and cached lookups behind Inspector toggles, so the naive path and each optimization can be profiled side by side.
Video only No in-browser build - the clip below is the full playthrough.
-
01
Baseline Naive Spawn & Destroy
Built the unoptimized pass that spawns a box per belt on a cooldown, slides it down,
Destroys it at the end, and callsFindObjectOfTypeto relocate the spawner every time - a deliberately wasteful baseline to profile against.BoxSpawner.cs -
02
Pooling Prewarmed Object Pool
Built a pool that prewarms hidden boxes at startup, hands one out on each spawn, and returns spent boxes by disabling them instead of destroying them, so steady-state spawning stops allocating and feeding the garbage collector.
OptimizationBoxSpawner.cs -
03
Reuse Hide Instead of Destroy
Made a pooled box disable its mesh renderer and its own update when it retires and switch them back on when reused, so the same object cycles down the belt over and over without being instantiated or collected again.
OptimizationBox.cs -
04
Caching Cached Spawner Lookup
Let each box either cache the spawner reference handed to it at setup or fall back to a scene-wide
FindObjectOfTypesearch, exposing the real cost of repeated lookups directly against the cached path.OptimizationBox.cs -
05
Control Toggleable Optimizations
Wired two Inspector booleans - use pool and cache spawner - to flip each optimization independently, so the same scene runs with every combination to measure exactly what each change saves on the frame budget.
OptimizationBoxSpawner.cs