Hi, I’ve noticed that Atom’s commands
editor:add-selection-below become really slow by the time you add 50+ lines to the selection. It gets progressively worse the more lines you add to the selection using those commands.
I can’t find any existing bug recorded for it, so I thought I’d try to help fix it. (I’ve never made changes to Atom before, so this might make a good first opportunity ).
So far, I used the Dev Tools to profile the problem, and I think I’ve found the function that is taking up the majority of the time:
MarkerLayer.createMarker. Its time is spread mostly between calls to
TextEditor.addCursor, via its call to Emitters.emit on
'did-create-marker'. It also may be resulting in calls to itself, again via Emitters.
I see that
MarkerLayer.createMarker checks a field
emitCreateMarkerEvents that can be used to skip emitting events. Could the solution be to not emit events for some subset of the calls to
I’m not really sure where to go from here, so any pointers or things to try would be useful. I can also share the .cpuprofile I collected with you, but Discuss didn’t let me attach it to this post.