-
Notifications
You must be signed in to change notification settings - Fork 49
Add MaxResults config option with default 10 #81
Conversation
This is great. One of the comments I hear about Atom is how it is sluggish - and the command palette is cited specifically. I then watch that user use Atom and I notice they have many items in the command palette. This would fix that issue, making sure that Atom leaves a great impression on the user. It seems that around a max of 20 items, would receive most of the benefits. Do you think 20 might be a better default? Separately - what can be done to make the "Collect" phase faster? It seems once you get into the range of 50 items max, the Collect phase starts to be the place with the biggest need for improvement. (Maybe someone else can think about that in another PR). |
What the situation? Like type some keystroke to narrow items and use mouse to scroll over items around 20 items?
IMO, this is difficult part, command collecting is essentially done by atom-core's command registry, and command-palette need to collect all available commands to filter matching command by fuzzy-match. |
Yes something like that. It's likely rare, with |
Thanks, Me too have no strong opinion as long as But have strong opinion to set it, to minimize possibility for new Atom user misunderstand "Atom is slow" by seeing command-palette's lag. This is typically happens when pure-Vim user migrate to Atom. |
Yes, I've seen this happen! |
Thought: maybe we could keep adding results as you scroll? Like what the Project Find results do now - it starts out with a few results but keeps adding more as you scroll. That way we also don't need to add a new config option. |
@50Wliu I thought of that too, but the implementation is probably a little more complex at that point. Can we start with a config and then later add some infinite scrolling? :D |
Agree to close this PRs. I still see adding item incrementally is ideal solution(value #81 (comment)). Anyway I want to see if hiding command contribute to reduce performance lag, and will re-think incrementally adding item approach if necessary. |
Description of the Change
When many commands are added,
command-palette:toggle
become non responsive.This PR add
MaxResults
options with default10
, which makecommand-palette:toggle
more responsive even after hundreds commands are added.New
MaxResults
config option, with default value10
.MaxResults
, it reduce rendering time and make command-palette more responsive.This PR introduce breaking change since it truncate items to
10
by default.7
in bundled UI themes(one-dark
,atom-dark
etc).Because main use-case of
command-palette
is narrow items byfuzzy-search
by keyboard, adding non-visible items is just add extra delay in most situation.So I set it's default to
10
.Even if this breaking change was not acceptable, I want this PR merged with different default value.
Background
When many commands are registered via community packages,
command-palette:toggle
become a little sluggish.vim-mode-plus
).How much improve responsiveness by this PRs.
Here is the result collected at this commit(44fd635) by following steps.
source.gfm
editor, start command-palette bycmd-shift-p
.collect
items, andrender
items.collect
+render
time is roughly the time command-palette shows up in UX perspective.No community packages( Atoms default )
Some packages installed
Alternate Designs
No alternate design I considered.
Benefits
command-palette:toggle
get more responsive by default, I believe it also make overall Atom's performance impression better.Possible Drawbacks
Results items on select-list is truncated to 10 items by default.
When user scroll over items on select-list, user can see only 10 commands( in previous release user could see all available commands ).
Applicable Issues
Fix #80
Related #35