cengels/skywriter

Rework document structure

Closed this issue · 0 comments

The document structure currently suffers from a significant performance issue. Whenever the document structure is refreshed (by calling refreshDocumentStructure(), that process takes a significant amount of time (over 100 ms). It has already been "optimized" in such a way that the document structure is not updated every time the user types something by checking whether an update to the document structure is actually necessary, but some actions (like undoing or redoing) still require a document structure refresh because it is not conventionally possible to check what changed after those actions. For instance, holding CTRL+Z currently results in significant lag after each undo.

To fix this, either

  1. diagnose the performance issues with refreshDocumentStructure() and, if possible, fix them
  2. make the refreshDocumentStructure() function asynchronous
  3. find a different way to accurately represent the document's structure without having to manually rebuild its structure each time a bigger change is made.

This issue is a part of #32.