Skip to content

Optimize relative positioning#1169

Merged
codeskyblue merged 3 commits intoopenatx:masterfrom
Zeros2619:optimize-relative-positioning
Mar 3, 2026
Merged

Optimize relative positioning#1169
codeskyblue merged 3 commits intoopenatx:masterfrom
Zeros2619:optimize-relative-positioning

Conversation

@Zeros2619
Copy link
Copy Markdown
Contributor

Improve performance significantly by introducing a new info_list method to retrieve all matched element information in one request,
which replaces the previous approach of fetching element information one by one for each request.

  • Performance boost: Reduce multiple jsonRPC requests to a single call
  • Method added: info_list() for batch element info retrieval

zeros.zhou added 3 commits March 3, 2026 11:15
Improve performance significantly by introducing a new `info_list` method to retrieve all matched element information in one request,
which replaces the previous approach of fetching element information one by one for each request.

- Performance boost: Reduce multiple jsonRPC requests to a single call
- Method added: info_list() for batch element info retrieval
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 3, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves relative-position selection performance in uiautomator2 by introducing a batch element info retrieval method and using it to reduce repeated JSON-RPC calls during right/left/up/down computations.

Changes:

  • Added UiObject.info_list() to fetch info for all matching instances in a single JSON-RPC call.
  • Updated __view_beside (used by right/left/up/down) to use info_list() instead of per-instance ui.info calls.

Comment thread uiautomator2/_selector.py
Comment thread uiautomator2/_selector.py
@codeskyblue
Copy link
Copy Markdown
Member

LGTM

@codeskyblue codeskyblue merged commit 4c21102 into openatx:master Mar 3, 2026
12 of 13 checks passed
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.

3 participants