Skip to content

perf: reuse projection icons during stable refresh - #174

Closed
10-X-eng wants to merge 1 commit into
performance/representative-publication-baselinefrom
performance/reuse-projection-icons
Closed

perf: reuse projection icons during stable refresh#174
10-X-eng wants to merge 1 commit into
performance/representative-publication-baselinefrom
performance/reuse-projection-icons

Conversation

@10-X-eng

@10-X-eng 10-X-eng commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Outcome

Eliminates measured duplicate icon work during the Tree and Feature Timeline refresh at the end of large publications.

  • Cache named SVG rasterization by resolved path, rendered pixel size, and exact color map.
  • Reuse the already-correct legacy Tree icon when the semantic browser renders the same document object with the same effective visibility.
  • Reuse exact Timeline icon variants within one rebuild using the Qt icon identity and complete visual-state bits.
  • Keep cache lifetime and ownership narrow; no persistent projection state was added.

Why

The representative 307-member Assembly trace proved that the final 1.864-second UI stall was dominated by duplicate Tree and Timeline icon generation, not semantic classification or tessellation.

Red / green evidence

Red baseline (build/run_vibescript_publication_307_native_trace.ps1):

  • Correct 307-member publication, but maximum GUI heartbeat gap: 1,863.733 ms (100 ms contract failed).
  • Browser item creation: 463.308 ms / 321.
  • Tree icon generation: 912.865 ms / 642.
  • Timeline icon transformation: 393.617 ms / 312.

Green, same fixture and command against the exact rebuilt Rattler/MSVC DLL:

  • Correct publication: 307 members / 322 objects.
  • Maximum GUI heartbeat gap: 644.622 ms (65.4% lower; remaining batching work is explicitly not claimed complete).
  • Browser item creation: 4.273 ms / 321 (99.1% lower).
  • Tree icon generation: 287.627 ms / 321 (68.5% lower).
  • Timeline icon transformation: 2.351 ms / 6 (99.4% lower).
  • Longest cooperative publication unit: 93.870 ms.

Focused test:

.pixi\envs\default\python.exe -m pytest src\Mod\VibeCAD\vibecad_tests\test_performance.py -q

Result: 12 passed.

Exact native build:

cmake --build <rattler-work-build> --target FreeCADGui --parallel 8

Result: passed with MSVC, followed by the native benchmark above. A red compile caught an incorrect QIcon/QPixmap argument during simplification; the corrected target rebuilt and linked cleanly before measurement.

Risk and non-goals

Risk is limited to icon caching/reuse. Failed SVG loads are not cached. Keys include every input that changes rendered output. This PR deliberately does not claim to solve the remaining 645 ms final projection stall; bounded GUI-thread widget batching is the next measured step.

Compatibility checklist

  • Existing public functions/APIs still present and behaviorally compatible.
  • No preference keys, tool names, or schema fields renamed or removed.
  • Defaults and visible behavior are unchanged.
  • No deprecations.
  • No breaking changes.

@10-X-eng

10-X-eng commented Sep 6, 2026

Copy link
Copy Markdown
Owner Author

Closed at the repository owner request; this performance implementation is being discarded.

@10-X-eng 10-X-eng closed this Sep 6, 2026
@10-X-eng
10-X-eng deleted the performance/reuse-projection-icons branch September 6, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant