Skip to content

Conversation

@banesullivan
Copy link
Contributor

@banesullivan banesullivan commented Apr 3, 2023

The tessellate() method can sometimes return pyvista.MultiBlock datasets with thousands of blocks. The internal plotting API here calls that method, often adding each returned element to the plotter with its own actors, mappers, lookup tables, etc -- this has significant performance implications when leveraging the Trame-based client rendering viewer as the scene graph then has tens of thousands of elements which have to be synchronized anytime something changes (e.g., edge visibility).

It is far more performant to use a single actor via PyVista's add_composite() plotting API to reduce the scene graph size. See https://docs.pyvista.org/api/plotting/_autosummary/pyvista.Plotter.add_composite.html#add-composite

I made further optimizations upstream in PyVista also to improve the responsiveness of camera controls: pyvista/pyvista#4223

pyvista/pyvista#4223 and this PR should resolve the performance issue seen with Trame that @RobPasMue brought to my attention

@github-actions github-actions bot added the bug Something isn't working label Apr 4, 2023
RobPasMue
RobPasMue previously approved these changes Apr 4, 2023
Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Thanks for the great feedback @banesullivan!! Really appreciated your contribution.

@RobPasMue RobPasMue merged commit ba84542 into main Apr 4, 2023
@RobPasMue RobPasMue deleted the patch/add_composite branch April 4, 2023 06:23
@banesullivan banesullivan removed their assignment Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants