-
Notifications
You must be signed in to change notification settings - Fork 171
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the marker in BasicMarkerUpdater::updateMarker in one operation #984
Update the marker in BasicMarkerUpdater::updateMarker in one operation #984
Conversation
Note, build failure is due #981. |
Do not use (up to) 3 workspace operations to update a marker, do it all in one single operation instead. Contributes to eclipse-platform#983
4fee33f
to
fa158ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
Thank you very much :-) Maybe I can pick your brain regarding a possible further optimization (in another PR)? Disclaimer: I haven't done the described optimization in this PR because it would require an API change and I wanted to keep this PR as small as possible while providing a quick win. |
Yes, but we should discuss this on a different PR :) |
Hello, this change causes a severe error in the breakpoint markers. Since now the method markers. setAttributes(Map<String, ? extends Object> attributes) will be used, all existing markers will be deleted and only the 3 markers char_start, char_end and line_number are set. The following bug comes up: In eclipse: I recommend to create and use a MarkerUtilities method which updates the marker instead of the marker.setAttributes(attributesChanged) call. An example see below. Best regards, Put this method in MarkerUtilities:
|
@DenisUngemach do you like to propose a PR? |
See 7da51e7 and comment from Denis Ungemach on eclipse-platform#984
@DenisUngemach : thanks and sorry, I've overlooked that completely. I've set a PR: #994 |
@iloveeclipse @fedejeanne Thanks for the fix and the performance optimizations! A batch marker update also sounds good. |
What it does
The current implementation of
BasicMarkerUpdater::updateMarker
triggers up to 3 Workspace-Operations to change a marker in a class when saving, those are:This PR lets
BasicMarkerUpdater::updateMarker
gather all changes that need to be done to a marker in aMap
and then apply all those changes in one single Workspace-Operation. This reduces the unnecessary overhead of opening/closing operations and all that it implies like looking for cycles in theOrderedLock
class and especially reducing the internal graph used to search for them (DeadlockDetector::reduceGraph
).Contributes to #983
How to test