The Wayback Machine - https://web.archive.org/web/20221207070027/https://github.com/atom/status-bar/pull/122
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make updating info faster for multi-cursor edits #122

Merged
merged 2 commits into from Feb 19, 2016
Merged

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Feb 16, 2016

With this PR, we take advantage of the fact that the information we present in status-bar is only based on the last cursor and selection. This means we can ignore most of the selection/cursor change events and only update the UI when the last event arrives.

Before

screen shot 2016-02-16 at 12 10 47

(Total: ~ 330ms, benchmarks performed by editing 3000 lines, inserting 5 characters)

After

screen shot 2016-02-16 at 12 10 19

(Total: ~ 7ms, 47x faster 馃悗)

Some thoughts

I wondered if we had to expose richer events in TextEditor and avoid to perform this last cursor/selection comparison, but ultimately I believe it's fine to let the clients decide when to perform certain events without cluttering TextEditor's public interface with events that can be synthesized pretty easily.

/cc: @nathansobo @maxbrunsfeld

as-cii added a commit that referenced this pull request Feb 19, 2016
Make updating info faster for multi-cursor edits
@as-cii as-cii merged commit 0a4bfc7 into master Feb 19, 2016
@as-cii as-cii deleted the as-multi-cursor-edit branch Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant