Hi there,I ran into a surprising performance issue.
My assistive app tries to find an AXUIElement somewhere in the application menu bar element tree of other apps.
Since I want it to look in all running apps that have UIElements, it inspects ALL UIElements of those apps that don't have a matching element.
The problem:
Let's say my app looks for an element with AXTitle "You won't find me" in Mail (of course no such element is found).
The first time I run my app it takes about 7 seconds to execute, the second time 16 seconds, the third time 33, then 56 and so on.
I quit my app and launch it again, now it takes almost 2 minutes. Something seems to accumulate in Mail...
Now the interesting point:
If I click in an arbitrary menu bar item once, I'm back to 7 seconds. Same if I quit Mail and launch it again.
Next, using a separate thread, I made my app click the "Mail" menu item periodically (once a second) during execution of my inspection method.
Result:
Now it takes only 2.5 seconds to perform the whole task!?
I observed the same behaviour with some other apps, for example Firefox.
Finder, XCode and Safari are not concerned.
I run Tiger on a slow G4 machine, so I can't tell whether this persists on Leopard...
Any hints or ideas?
Greately appreciate your help,
Peter