CMake flags that are used for vtk-wasm-sdk?

Hi,

after switching from SDL2-based wasm of VTK 9.3.1 to WebAssembly-based functionality in 9.4.1 (or the current main branch), I have noticed that my own compiled WASM app runs magnitudes slower compared to a build with the vtk-wasm-sdk docker image. One render pass needs about 300 ms - it feels like this is magnitudes more than with the vtk-wasm-sdk docker image (32bit, no threads) and also much more than with (a patched) build using VTK 9.3.1 via SDL2.

I would be interested in the CMake flags that have been used for creating the libraries in the vtk-wasm-vtk in order to reproduce the speed in a home-built app. I guess the ones found in .gitlab/ci/docker/Dockerfile · main · VTK / vtk-wasm-sdk · GitLab might be not the currently used ones?

@jaswantp, do you know where I can find them? The ones I have used (for the slow rendering) are the following (see Building using emscripten for WebAssembly - VTK documentation)

-DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_BUILD_TYPE:STRING=Release
-DVTK_ENABLE_LOGGING:BOOL=OFF
-DVTK_ENABLE_WRAPPING:BOOL=OFF
-DVTK_WEBASSEMBLY_64_BIT=OFF
-DVTK_WEBASSEMBLY_THREADS=OFF
-DVTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2:BOOL=DONT_WANT
-DCMAKE_CXX_FLAGS_RELEASE=“-O3”
-DVTK_ENABLE_WEBGPU:BOOL=ON

I am using emsdk 3.1.74.

Thanks,

Sophonet.

Hello @Sophonet

Those flags are currently used for the vtk-wasm-sdk image.

The vtk-wasm-sdk image is built using emsdk 3.1.64, whereas you seem to use emsdk 3.1.74. Maybe there is something wrong with the newer emsdk? Can you try emsdk 3.1.64 instead?

Thanks @jaswantp. It turned out that somehow the flags I have mentioned were not used - instead, a debug version was built and that was horribly slow.

Thanks for posting an update. I am genuinely relieved that emsdk version is not to blame :slight_smile: