Skip to content

Fix perf issue on get locations of breakpoint#88

Merged
testforstephen merged 1 commit into
masterfrom
jinbo_breakpointperf
Oct 25, 2017
Merged

Fix perf issue on get locations of breakpoint#88
testforstephen merged 1 commit into
masterfrom
jinbo_breakpointperf

Conversation

@testforstephen

Copy link
Copy Markdown
Contributor

Signed-off-by: Jinbo Wang jinbwan@microsoft.com
fix bug #49.

Nested types are just needed for those already loaded classes. For the referenceType from ClassPrepareEvent, no need to search the locations in the nested types. For newly loaded classes, the debugger has also registered ClassPrepareRequest for their local types, so the debugger will handle the local types in ClassPrepareEvent handler.

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
List<Location> newLocations = collectLocations(refType, lineNumber);
if (!newLocations.isEmpty()) {
locations.addAll(newLocations);
} else if (includeNestedTypes) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just if?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the advice?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean why here it is else if rather than if?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the breakpoint located in the refType, no need to search the nested type.

@testforstephen
testforstephen merged commit ece63b8 into master Oct 25, 2017
@testforstephen
testforstephen deleted the jinbo_breakpointperf branch October 25, 2017 02:48
@Goom11

Goom11 commented Aug 21, 2018

Copy link
Copy Markdown

Hello, @testforstephen, how do you know that ReferenceType.nestedTypes invokes VirtualMachine.allClasses?

@testforstephen

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants