Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup performance #1348

Open
Meakk opened this issue Apr 1, 2024 · 4 comments
Open

Startup performance #1348

Meakk opened this issue Apr 1, 2024 · 4 comments
Assignees
Labels
type:bug Something isn't working
Milestone

Comments

@Meakk
Copy link
Contributor

Meakk commented Apr 1, 2024

Describe the bug
A large amount of time is spent in the volume mapper initialization when launching f3d even if it's not used

2024-04-01-151421_1039x889

To Reproduce
Steps to reproduce the behavior:

  1. Open the file using valgrind --tool=callgrind f3d --dry-run cow.vtp --output=/tmp/out.png

Expected behavior
The time spent in volume mapper initialization should be negligible

System Information:

  • OS: all?
  • GPU and GPU driver: irrelevant

F3D Information
Paste the content of f3d --version:
2.4 and current master

@mwestphal mwestphal added this to the 2.5.0 milestone Apr 4, 2024
@mwestphal mwestphal added the type:bug Something isn't working label Apr 4, 2024
@kidharb
Copy link
Sponsor Contributor

kidharb commented May 3, 2024

I would like to try fixing this bug

@Meakk
Copy link
Contributor Author

Meakk commented May 3, 2024

@kidharb here's an idea. We are using vtkNew which allocates the class immediately. Maybe we could use vtkSmartPointer instead and trigger the allocation only when it is needed.

@kidharb
Copy link
Sponsor Contributor

kidharb commented May 17, 2024

@kidharb here's an idea. We are using vtkNew which allocates the class immediately. Maybe we could use vtkSmartPointer instead and trigger the allocation only when it is needed.

I finally understand what you mean :-P
I was able to reproduce the issue and see that vtkSmartVolumeMapper is taking up some time.

@kidharb
Copy link
Sponsor Contributor

kidharb commented May 21, 2024

From @mwestphal comments on Discord (slightly edited for Github)

The problem is that the Volume code is in vtkF3DGenericImporter and all of this Volume code should be in
vtkF3DRendererWithColoring::ConfigureVolumeForColoring instead.

In short, vtkF3DGenericImporter should still hold a vtkSmartVolumeMapper which should be nullptr when we start the app.
The first time vtkF3DRendererWithColoring::ConfigureVolumeForColoring tries to use vtkSmartVolumeMapper the vtkF3DGenericImporter should initialize it.

To solve this issue, create a vtkF3DGenericImporter::InitializeVolumeMapper and call it just before calling vtkF3DRendererWithColoring::ConfigureVolumeForColoring in vtkF3DRendererWithColoring, if and only if the propAndMapper.second == nullptr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: Investigate
Development

No branches or pull requests

3 participants