Skip to content

web version built with WASM#145

Open
BSVogler wants to merge 65 commits intomolovol:masterfrom
BSVogler:wasm
Open

web version built with WASM#145
BSVogler wants to merge 65 commits intomolovol:masterfrom
BSVogler:wasm

Conversation

@BSVogler
Copy link
Contributor

@BSVogler BSVogler commented Jan 12, 2025

This builds up on #144

WASM is code in assembly that is run by the browser. We can generate it from the C++ code.
This allows static hosting of the molovol web page as no python back-end is required. This increases the expected uptime and reduces hosting cost.

It also gives users more privacy as the computation runs locally and the files do not need to be sent to the server.
It might run 20% slower in wasm than in C++ (other benchmark numbers), however the server is slower than most scientist machines so total speed should be higher.

Demo here

@rlavendomme
Copy link
Collaborator

This builds up on #144

WASM is code in assembly that is run by the browser. We can generate it from the C++ code. This allows static hosting of the molovol web page as no python back-end is required. This increases the expected uptime and reduces hosting cost.

It also gives users more privacy as the computation runs locally and the files do not need to be sent to the server. It might run 20% slower in wasm than in C++ (other benchmark numbers), however the server is slower than most scientist machines so total speed should be higher.

What would be the result if scientists purposely use the web app because they want to run a calculation from a computer with poor hardware? If they don't have enough RAM, for instance, would it crash their browser and maybe computer?
I think that the main purpose of a web app is to not burden the local computer of users.
With this proposed build, the only purpose of the web app would be to not install the standalone program.

@BSVogler
Copy link
Contributor Author

BSVogler commented Jan 12, 2025

The web server I use for hosting only has < 6 GiB of memory available for molovol. Most desktop devices have more memory. The purpose was not to provide a high-end machine for the user. The purpose of the web version is to skip the installation step in the user journey.
I have however not extensively tested it with big computations and I found one issue related to memory access when running the surface computation with one file format. I have not yet compared that case with the CLI version.
If there is a file that I can use for benchmarking memory consumption I would be happy to test it.

@BSVogler
Copy link
Contributor Author

I run the 6s8y.xyz and it ran for around 52s in Safari. The version on the back end only for 6s. The local version should be faster.

Suggestions: allow using a remote url for a back-end with preconfigured server that we host for users to choose as an intermediate step.
The page responsiveness could also be improved.

use web workers for a second thread so that the ui thread is still responsive
@BSVogler
Copy link
Contributor Author

BSVogler commented Jan 17, 2025

The page responsiveness could also be improved.

I added support for running it in a separate thread and made the output parsing looking nicer.

Update .gitignore

test: Add basic test function and enable testing in CMake

build: Add C flag for stripping release build

chore: Remove unused testing configuration in CMakeLists.txt

add basic testing

docs: Add comments to cmake/Testing.cmake

fix: Explicitly build test executables before running them

fix: Correctly configure CMake to run tests automatically

fix: Correct add_test command in Testing.cmake

refactor: Consolidate tests into a single executable

fix: Link gtest library to molovol_test executable

fix: Add find_package(gtest REQUIRED) to CMakeLists.txt

refactor: Improve CMake testing best practices

fix: Explicitly set gtest include directory in CMake

refactor: Improve CMake's Google Test include handling

fix: Correct Google Test package name in CMakeLists.txt

refactor: Make Google Test dependency optional for tests

build: Move custom test target definition to Testing.cmake

feat: Ensure tests run during main build process

refactor: Separate test execution using ctest

fix: Ensure molovol_test is built when MOLOVOL_BUILD_TESTING is ON

fix: Include Testing.cmake when building tests

fix test

build: Add Google Benchmark library to CMakeLists.txt

fix test

remove compiler warnings
compiles faster as there are no redundant compilation steps for each target
@BSVogler BSVogler mentioned this pull request Jul 6, 2025
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.

3 participants