Parallel skinning and texture decoding, --bench option #2

Merged
dev merged 4 commits from devin/1795844914-render-perf into main 2026-11-28 00:58:09 -05:00
Owner

Speeds up loading and posing on all platforms and adds a benchmark option.

  • Poser::update() now runs skinning (and the per-update morph base copy) across hardware threads via a new mr::parallelFor (src/model/Parallel.h); small models stay single-threaded.
  • ModelNode decodes all texture images in parallel up front (preloadTextureImages()), since PNG decoding dominated load time.
  • Textures use setUnRefImageDataAfterApply(true), freeing the CPU copy (~170 MB for Karin) after upload.
  • New --bench N CLI option prints load time, first-frame time, idle/animated frame time and CPU deformation time. Load time is also printed on the Loaded ... line.
  • Threads::Threads linked to mr_core.

Measured on the Intel MacBook Air (i7-5650U, HD 6000), before → after:

Model Load CPU deform per pose change Animated frame
Karin.pmx 2360 → 1630 ms 3.24 → 2.22 ms 16.8 → 16.7 ms (vsync)
Karin_ver1.1.0.fbx 3787 → 3075 ms 4.44 → 1.58 ms 18.6 → 16.9 ms

Idle rendering was already vsync-locked at 60 FPS; the 12 FPS seen earlier was the ImGui average still including the ~1 s first frame (texture upload).

Written by Devin

Speeds up loading and posing on all platforms and adds a benchmark option. - `Poser::update()` now runs skinning (and the per-update morph base copy) across hardware threads via a new `mr::parallelFor` (`src/model/Parallel.h`); small models stay single-threaded. - `ModelNode` decodes all texture images in parallel up front (`preloadTextureImages()`), since PNG decoding dominated load time. - Textures use `setUnRefImageDataAfterApply(true)`, freeing the CPU copy (~170 MB for Karin) after upload. - New `--bench N` CLI option prints load time, first-frame time, idle/animated frame time and CPU deformation time. Load time is also printed on the `Loaded ...` line. - `Threads::Threads` linked to `mr_core`. Measured on the Intel MacBook Air (i7-5650U, HD 6000), before → after: | Model | Load | CPU deform per pose change | Animated frame | |---|---|---|---| | Karin.pmx | 2360 → 1630 ms | 3.24 → 2.22 ms | 16.8 → 16.7 ms (vsync) | | Karin_ver1.1.0.fbx | 3787 → 3075 ms | 4.44 → 1.58 ms | 18.6 → 16.9 ms | Idle rendering was already vsync-locked at 60 FPS; the 12 FPS seen earlier was the ImGui average still including the ~1 s first frame (texture upload). [Written by Devin](https://app.devin.ai/sessions/edc92906d52f4fb09179a164d60f5f27)
dev added 4 commits 2026-11-28 00:53:07 -05:00
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dev merged commit 091c036d7b into main 2026-11-28 00:58:09 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/3d-model-renderer#2