When using git-changebar plugin under Geany (which displays vertical line indicating changed lines), removing many lines, e.g. using undo, causes long delays. After profiling, I found this is because MarkerHandleSet::CombineWith() has to walk the
whole list every time a single line is removed (see the attached svg with the profile and the commit message for more information).
While the git-changebar plugin could probably be modified to remove the markers before the undo action (and not after it which is the case now), it's probably better to fix this in Scintilla because the issue is not obvious from the outside.
This patch uses std::list which contains pointers both to the beginning and the end of the list so no traversing is needed. It would be possible to use std::set too but since the set would have to be defined on (handle, number) and most of the operations look for either handle or number, we would have to walk the set linearly anyway (and walking the RB tree of set might be slower).
Log in to post a comment.