Skip to content

perf(camera): use getViewMatrix output parameter to avoid copy#3549

Merged
finetjul merged 3 commits into
Kitware:masterfrom
finetjul:use-getviewmatrix-new-parameter
Jul 13, 2026
Merged

perf(camera): use getViewMatrix output parameter to avoid copy#3549
finetjul merged 3 commits into
Kitware:masterfrom
finetjul:use-getviewmatrix-new-parameter

Conversation

@finetjul

Copy link
Copy Markdown
Member

By providing the expected output array, one can avoid an array copy

Context

Following #3544, we can improve the usage of getViewMatrix

Results

Some functions will get faster.

Changes

  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js: master
    • OS: Windows
    • Browser: Firefox

By providing the expected output array, one can avoid an array copy
@finetjul finetjul requested a review from PaulHax July 13, 2026 08:47
Avoids getViewMatrix using the module-private tmpMatrix as scratch and also lets
callers pass that same tmpMatrix in as the output buffer, which required
a `result != tmpMatrix` guard and a "out can be tmpMatrix" caveat.
@PaulHax

PaulHax commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Looks good. Little followup to avoid extra matrix copy finetjul#3 and fix behavior.js formating

perf(camera): build view matrix directly into out buffer
@finetjul finetjul added this pull request to the merge queue Jul 13, 2026
Merged via the queue into Kitware:master with commit c2aa926 Jul 13, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 36.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Automated label label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants