Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Deprecate individual Marker events #152

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

as-cii
Copy link
Contributor

@as-cii as-cii commented Apr 25, 2016

Subscribing and emitting events for every single marker is an expensive operation for a number of reasons, and its cost increases as the number of markers goes up: for instance, just emitting the event with no information becomes onerous when there are lots of markers and/or subscribers.

With this pull-request we want to make subscribing to individual marker event an anti-pattern and thus deprecate it. We have planned to do so by changing MarkerLayer.prototype.onDidUpdate in two ways:

  1. We have introduced the created, updated, touched and destroyed sets in the event object, which respectively indicate the ids for markers that were created, manually updated, updated because of a textual change, and destroyed.
  2. We have changed the way in which the event is scheduled. In particular, subscribers will now be notified at the end of the transaction wrapping the marker changes, or synchronously if no transaction was initiated.

/cc: @nathansobo

@as-cii as-cii force-pushed the deprecate-marker-events branch from 79e6eec to a34cb8d Compare April 25, 2016 11:56
@as-cii as-cii force-pushed the deprecate-marker-events branch 2 times, most recently from 94e4826 to 1fffd5c Compare May 3, 2016 14:48
@aminya
Copy link
Contributor

aminya commented Sep 30, 2020

@as-cii @maxbrunsfeld

Is this PR still relevant? I know you are not involved with Atom anymore much, but I want to know if I should spend time on reviving this pull request. Linter uses markers and decorators heavily, and any performance improvement can improve the overall experience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants