Skip to content

Non-blocking UI during scene loading #123

@stlemme

Description

@stlemme

When starting with a small scene and then programmatically adding a few hundred model tags with remote assets cause the UI to block sporadically during the loading phase of those (pure XML) assets.

This is probably caused by computationally heavy callbacks (after XHR response) blocking the UI thread for the length of several frames. This breaks the user experience when continuously interacting with the scene from the beginning.

This might be solved by a two step approach:

  1. minimize computational effort within XHR callbacks
    • add a global task queue to resource manager
    • when XHR returns, the callback just adds a new task to this queue
    • in each frame, a small number of tasks is taken from the queue and actually executed
  2. perform actual computation asynchronously using other than UI thread
    • instead of executing the tasks in each frame yourself, manage a pool of workers that
    • picks regularly a task from the queue
    • and executes each task without affecting the UI thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions