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 code execution in the background #12

Open
habbes opened this issue May 12, 2018 · 1 comment
Open

Explore code execution in the background #12

habbes opened this issue May 12, 2018 · 1 comment
Labels

Comments

@habbes
Copy link
Owner

habbes commented May 12, 2018

At the moment the source code in the editor is evaluated and executed on the main thread, if the code has a long running loop, it would freeze the UI. Consider running the code in a background worker.

@habbes habbes added performance major major feature labels Jun 2, 2018
@habbes
Copy link
Owner Author

habbes commented Jun 3, 2018

I've done some research on web workers and realised this task will be more demanding than I thought because of the restrictions on what you can pass around between the host and web worker.

I started experimenting with some possible implementations that may work for Xaval. Here's one demo of creating a "bridge" between the host page and web worker. I might explore other ideas and approaches.

This feature might also require me to rethink the architecture and foundation of Xaval and some of its APIs and end up requiring considerable changes and maybe rewrites. I can already foresee that all I/O APIs will have to be asynchronous (e.g. imageSource.read()) and I'm not sure yet how this would work with widget models (whether they'll live in the host or worker).

For this reason, I think it's best I work on this after I've worked on some of the other useful but less-demanding features (e.g. multi-file library, video support, widgets improvements, etc.) because working on this might block development of other features for a couple of weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant