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

Rework document structure #38

Closed
cengels opened this issue Aug 7, 2020 · 0 comments
Closed

Rework document structure #38

cengels opened this issue Aug 7, 2020 · 0 comments
Assignees
Labels
bug Something isn't working other The issue concerns another part of the application resolved The issue's problem is now resolved
Milestone

Comments

@cengels
Copy link
Owner

cengels commented Aug 7, 2020

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.

@cengels cengels added bug Something isn't working other The issue concerns another part of the application labels Aug 7, 2020
@cengels cengels added this to the Core milestone Aug 7, 2020
@cengels cengels self-assigned this Aug 7, 2020
cengels added a commit that referenced this issue Dec 21, 2020
Previously the text document would only re-count the words for a given
segment if it found a word separator in front or behind it. This
approach was flawed, though. Due to the fact that there is no way to
retrieve the character sequence that was added or removed, it is
impossible to accurately determine whether the text change included a
word separator or not.

By always re-counting the words, for instance, opening and closing
comments now always count correctly.

This is likely to have some performance impact, but initial tests did
not see an immediate problem. Any further problems will likely be
resolved by #38.
@cengels cengels added the resolved The issue's problem is now resolved label Mar 6, 2021
@cengels cengels closed this as completed Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working other The issue concerns another part of the application resolved The issue's problem is now resolved
Projects
None yet
Development

No branches or pull requests

1 participant