Skip to content
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

fix: Properly exclude attributes from snapshots to speed up xpath lookup #386

Merged
merged 10 commits into from
Oct 9, 2020

Conversation

mykola-mokhnach
Copy link
Contributor

Previously we were only excluding redundant attributes from the xml itself, which did not affect the performance much, but now we also exclude them from snapshots. And it does the job

@mykola-mokhnach mykola-mokhnach changed the title fix: Properly exclude attributes from snapshots to speed up xpath lookup [WIP] fix: Properly exclude attributes from snapshots to speed up xpath lookup Oct 9, 2020
@mykola-mokhnach mykola-mokhnach changed the title [WIP] fix: Properly exclude attributes from snapshots to speed up xpath lookup fix: Properly exclude attributes from snapshots to speed up xpath lookup Oct 9, 2020
@mykola-mokhnach
Copy link
Contributor Author

CC @sshock

@sshock
Copy link
Contributor

sshock commented Oct 9, 2020

CC @sshock

Oh nice. Will be interesting to see if this helps our performance.

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

The code change seems good to me. (I haven't tested this well with this branch tho.)

@dpgraham
Copy link
Contributor

dpgraham commented Oct 9, 2020

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 1
           

Complexity increasing per file
==============================
- app/src/main/java/io/appium/uiautomator2/model/UiElementSnapshot.java  16
- app/src/main/java/io/appium/uiautomator2/utils/ElementLocationHelpers.java  1
         

See the complete overview on Codacy

if (value != null) {
attribs.put(key, value);
}
}

private Map<Attribute, Object> collectAttributes(AccessibilityNodeInfo node, int index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@mykola-mokhnach mykola-mokhnach merged commit 7a9b6da into appium:master Oct 9, 2020
@mykola-mokhnach mykola-mokhnach deleted the nodes branch October 9, 2020 20:08
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.

4 participants