Skip to content

perf(Renderer): accumulate actors and volumes without concat - #3638

Open
PaulHax wants to merge 1 commit into
Kitware:masterfrom
PaulHax:upstream-renderer-actors
Open

perf(Renderer): accumulate actors and volumes without concat#3638
PaulHax wants to merge 1 commit into
Kitware:masterfrom
PaulHax:upstream-renderer-actors

Conversation

@PaulHax

@PaulHax PaulHax commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Context

getActors() and getVolumes() collect each prop's objects using repeated
concat calls. Each concat call copies the growing result array.
This quadratic work repeats on every getActors call, including getActors()
during picking without an explicit pick list.

Batching geometry into fewer actors is the vtk.js way, but separate
actors are useful when datasets load and unload independently. This change came
out of loading tiled point clouds, where chunks of points are swapped in and out as the view changes.

Results

Recorded headless Chromium medians per collection call, spanning actor and
volume results:

Count Before After
400 0.05–0.06 ms 0.005–0.010 ms
2,000 1.08–1.21 ms 0.035–0.055 ms

At 2,000 objects, this saves roughly 1 ms per call.

Changes

  • Use a shared push helper for linear collection, preserving array and
    non-array prop answers.
  • Preserve order and fresh snapshots; by-reference getters return the latest
    snapshot.

PR Checklist

  • GitHub Actions CI passed: semantic-release commit messages, lint, and tests
  • Test coverage added
  • Documentation and TypeScript definitions are updated to match these changes

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