You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Typing a character in Atom involves three main operations: keeping the model up to date, rendering the newly inserted character, and showing suggestions for the current word. These tasks are summarized by the following CPU profile (captured on a real-world JavaScript file with ~ 3000 lines):
In this example autocomplete-plus blocked the main thread for 34.7ms and occupied 68% of the entire profile. It's worth noting that during that amount of time, Atom could have rendered two more animation frames.
There are two main reasons why this code path took so long:
Fetching suggestions is unnecessarily complex and slow. Instead of storing and indexing symbols along with their tokens when the buffer changes, we could simply search for all the occurrences of a certain pattern and then query those locations to get the syntax information. The search can be done in C++, which should scale quite nicely as the file gets bigger. A second step here could be to investigate some indexing data structures (such as suffix trees/arrays) to speed this up even further.
Rendering suggestions uses obsolete techniques and displays too many items. The current manual DOM manipulation should be replaced with an etch component that takes care of efficiently rendering an infinite scrolling list, swapping elements in and out as the user scrolls.
/cc: @atom/maintainers
The text was updated successfully, but these errors were encountered:
Just wanted to drop an update here. We've moved subsequence searching into a native function that searches in a background thread. We've also made a bunch of rendering optimizations, so the amount of rendering we do on each key stroke is fairly minimal.
Typing a character in Atom involves three main operations: keeping the model up to date, rendering the newly inserted character, and showing suggestions for the current word. These tasks are summarized by the following CPU profile (captured on a real-world JavaScript file with ~ 3000 lines):
In this example autocomplete-plus blocked the main thread for 34.7ms and occupied 68% of the entire profile. It's worth noting that during that amount of time, Atom could have rendered two more animation frames.
There are two main reasons why this code path took so long:
/cc: @atom/maintainers
The text was updated successfully, but these errors were encountered: