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

Don't block on long algorithms #21

Open
sharmaeklavya2 opened this issue Jan 17, 2021 · 0 comments
Open

Don't block on long algorithms #21

sharmaeklavya2 opened this issue Jan 17, 2021 · 0 comments

Comments

@sharmaeklavya2
Copy link
Owner

Currently, long packing algorithms like opt-guill-ks block the main thread, which makes the UI unusable. We should have a way of running it in a non-blocking way and allow the user to cancel the algorithm.

Maybe we can wrap these algorithms in a web worker.

Another alternative is to convert these algorithms to generators, and add yield statements at appropriate points. This allows us to pause and resume them. The drawback is that it can be tricky to add yield statements appropriately. If yields are too far apart in time, then we will continue to face main-thread-blocking, and if they are too close together, then the packing algorithm's performance may get degraded.

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

No branches or pull requests

1 participant