FIX * fix slowness
- fix extremely slow behavior on huge files (50 thousand lines, by eg)
The function on_modified it's called after every key is pressed, doing the sublime extremely slow on huge files with 30 or 50 thousand lines.
I change to on_modified_async to avoid this problem.
I'm sorry, but I cannot accept this modification because asynchronous operations may cause issues with code color refreshing. If you want to improve the performance in the case of large files, there are a couple of methods you can consider.
One approach is to follow the algorithm used by Visual Studio Code (VSC), which maintains a tree-like data structure that allows for efficient insertions, deletions, modifications, and lookups. However, implementing this algorithm can be challenging from an algorithmic perspective.
Another approach is to perform the operations asynchronously but with cancellable tasks. Each time the on_modified event occurs, you can cancel the previous task and submit a new task instead. This way, you can ensure that only the latest task is executed, reducing the potential lag caused by processing previous outdated tasks.