IncrementalTextDocument.getText performance issue
See original GitHub issueIncrementalTextDocument.getText
is much slower than FullTextDocument.getText
Unfortunately, there’s existing code that calls TextDocument.getText in loops. TextDocument.getText is the only API to get the content of a TextDocument and it was never specified that this is a potentially expensive operation.
The fix is probably to have IncrementalTextDocument.getText remember the string instead of recomputing it every time.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
performance overhead of the gettext internationalization ...
What is the performance overhead during startup of a program that uses gettext (load shared library? How are the translations loaded into ...
Read more >Using the gettext filter – legit or not? - WordPress.org
A simple text change will not cause that significant of a performance issue, but if there is any logic involved in the gettext...
Read more >The dangers of the gettext filter - Pippin's Plugins
The filter provides a way to easily change international-ready text via a simple filter call, but it can also have a serious impact...
Read more >Language Server Extension Guide - Visual Studio Code
Learn how to create Language Servers to provide rich language features in Visual Studio Code.
Read more >GNU gettext utilities
Please include the manual's edition number and update date in your messages. ... a poor performance if some string has to be translated...
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 FreeTop 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
Top GitHub Comments
@aeschli and I had a long disucssion about this. Our finding are:
So we decided to move forward as follows:
Let server implementors decide which incremental text buffer implementation they want to use. One will be piece tree implementation.
Since we never had the incremental text document in a NON next version this will not be a breaking change.
It sounds right to me. The way of reading text buffer can be only optimized based on what the scanner asks for and the detailed implementation of the buffer.
vscode-textbuffer
can be used as an example how another text buffer implementation can be hooked into lsp-node in samples or readme.