Skip to content

Don't block on long algorithms #21

Description

@sharmaeklavya2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions