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

Explore opportunities for non-UI-blocking processing #7

Open
blenderskool opened this issue Dec 5, 2021 · 5 comments
Open

Explore opportunities for non-UI-blocking processing #7

blenderskool opened this issue Dec 5, 2021 · 5 comments
Labels
editor Related to the Vyaakaran editor FOSS Hack Good issues for FOSS Hack participants

Comments

@blenderskool
Copy link
Owner

All the core Vyaakaran processing happens on the main thread which may lead to blocked UI in some heavy and long-running algorithms. Explore ways of moving these algorithm calls to maybe Web Workers which can be physically terminated by the user if they don't prefer waiting.

@blenderskool blenderskool added editor Related to the Vyaakaran editor FOSS Hack Good issues for FOSS Hack participants labels Jun 22, 2024
@PochamVarun
Copy link

@blenderskool
HI, I am a participant from FOSS Hack, can we please take up this issue. Should we send a proposal for this??

@blenderskool
Copy link
Owner Author

@PochamVarun Yes, it would be great if you can share your approach before you actually work the issue. I would also be able to help and share my thoughts.

@PochamVarun
Copy link

@blenderskool First, I will create a Web Worker Script to isolate core processing logic into a standalone JS file with nesassary functions and logic to handle preprocessing. Then, Create an instance of the web worker on the main JS file and handle communication between the main thread and the worker. Also, add buttons to allow user to start or stop processing to ensure that heavy processing tasks do not block the UI.

@blenderskool
Copy link
Owner Author

@PochamVarun this approach sounds fine. Most of the core processing logic (which has to be moved in web workers) are already a part of a separate compiler module. If we are able to run the functions exposed by the compiler in context of a web worker, that should work out fine.

Do take a look at libraries like Comlink to make the interfacing with web workers easier. Serializing and Deserializing structures across worker via postMessage calls throughout the codebase can quickly get messy!

@PochamVarun
Copy link

Yeah, sure @blenderskool

blenderskool pushed a commit that referenced this issue Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Related to the Vyaakaran editor FOSS Hack Good issues for FOSS Hack participants
Projects
None yet
Development

No branches or pull requests

2 participants