question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need to improve print_control_identifiers() performance with depth param

See original GitHub issue

I’ve observed very slow behavior for iTunes (tab “Store”).

>>> len(app.iTunes.descendants()) # takes ~2.5-3 sec.
3024
>>> len(app.iTunes.children()) # takes less than 0.1 sec.
5

app.iTunes.print_control_identifiers() takes more than a minute! Couldn’t wait it for a reasonable time. Even if I set argument depth=1.

I think we need to improve this at least for some constrained depth value.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
cetygamercommented, May 21, 2017

The cause is UIAWrapper.__hash__ method. https://github.com/pywinauto/pywinauto/blob/master/pywinauto/controls/uiawrapper.py#L198 A lot of controls don’t have RuntimeId field, so mapping dictionary out of controls in order to build control tree takes a very long time. Typical item in iTunes app looks like this: image

0reactions
vasily-v-ryabovcommented, Mar 15, 2021

This issue as it was submitted initially is fixed in atspi branch by PR #1049. Let’s continue other optimization topics in #256.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pywinauto Documentation - Read the Docs
print_control_identifiers() gets bytes string on Python 3.x. – Importing pywinauto causes debug messages to appear twice. • Improved click ...
Read more >
pywinauto.application module - Read the Docs
The application module is the main one that users will use first. When starting to automate an application you must initialize an instance...
Read more >
pywinauto 0.6.5 documentation - 一译
print_control_identifiers() gets bytes string on Python 3.x. Importing pywinauto causes debug messages to appear twice. Improved click methods behaviour for ...
Read more >
sitemap-questions-21.xml - Stack Overflow
... .com/questions/4557387/is-a-url-query-parameter-valid-if-it-has-no-value ... /questions/19618105/how-to-improve-performance-of-geoip-query-in-bigquery ...
Read more >
Pywinauto unintended result when initiating button control ...
I have modelled my code similarily to the answer provided in this question: ... dlg.print_control_identifiers().
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found