01-25-2016, 03:30 PM
Finding an accessible object in some windows is slow. You can see it in dialog 'Find accessible object' when you click Test. In code you can measure speed with PerfFirst/PerfNext/PerfOut.
But caching accessible objects in global variables would be useful only if these find-object functions are called so frequently that you see increased CPU usage of qm.exe process in Task Manager or Process Explorer.
If finding is too slow, at first I would try to make it faster. For example, try to find a temporary object, then search in it.
3. Possible, but it would be the same object, invalid in other threads. Maybe possible to marshal it to another thread, I'll read about it and try.
But caching accessible objects in global variables would be useful only if these find-object functions are called so frequently that you see increased CPU usage of qm.exe process in Task Manager or Process Explorer.
If finding is too slow, at first I would try to make it faster. For example, try to find a temporary object, then search in it.
3. Possible, but it would be the same object, invalid in other threads. Maybe possible to marshal it to another thread, I'll read about it and try.