Mark Text performance improvement
See original GitHub issueDescription
At the moment Mark Text using a simple String to represent the document content. When it comes to larger documents, this is very inefficient and result in high CPU and RAM usage because we create many copies from the String.
A solution would be to use a (immutable) data structure with support for snapshots (undo/redo) and better memory management. I don’t want to go into the detail, but the explanation from Juan Pedro Bolivar Puente of his talk “Postmodern immutable data structures” or Atom’s/vscode’s blog post, does indeed. There are already libraries, which we can use like Superstring from the Atom text editor.
Problems
- How do we interact with CodeMirror and the virtual HTML DOM stuff. Should we fork/implement this by our own and consider this problem?
- Can we “just” change your API to use a different data structure?
Note to self: Atom has written a blog post about integrating Superstring with a virtual DOM.
Existing implementations
- Superstring - Native library at the core of Atom’s text editor.
- Postmodern immutable and persistent data structures for C++
- immutable.js - Immutable persistent data collections for Javascript
- CodeMirror’s text buffer
References
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:7 (4 by maintainers)
Top Results From Across the Web
A Reproducibility Concern about Image-Text Retrieval
According to their assertions, these techniques provide improved modality interactions and hence more precise multimodal representations. In ...
Read more >Enforce Performance Improvement Plan Mark | signNow
Check out how easily the enforce Performance Improvement Plan mark feature ... Open a sample document to add a signature, date, text, upload...
Read more >Performance improvement while querying TEXT column
Performance improvement while querying TEXT column. Hello, I have a table 'Document' with a TEXT column, say DocumentBody. The column has huge data....
Read more >Improve the Performance of Full-Text Indexes - SQL Server
If re-routing occurs frequently, it results in performance degradation of the full-text indexing process. To work around this problem, mark the ...
Read more >how to improve performance | SAP Community
I have the following code snippet: *fetch data from table using select *now for each record, get the text using read_text loop on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Using Marktext 0.14.0-3 – marktext-bin in the AUR on a very high end system
Wanted to drop by and note that this is actually affecting real world use cases. I’m working on a massive markdown document over at https://github.com/VegaDeftwing/opinionatedeng/blob/master/opinionatedeng.md and hoboy does marktext get laggy, but then again so does everything else. Even just a raw text editor, like VSCode, with syntax highlighting for the markdown just gets bogged down.
I haven’t dug though the code at all so I’m not sure if these are done already or the feasibility/practicality of any of these recommendations but:
I know that many of these suggestions hit the same issue as described above- a significant refactor is necessary no matter what, even if just switching to a better data structure as originally suggested.
Thanks for all the great work on this project 😃
EDIT: just checked the roadmap and saw that it’s at the top and already well planned out. Thanks again to everyone working so hard on this!
Source Code Mode is much slower than WYSIWYG mode.