PowerBuilder 2019 R3 Build 2728
Windows 10 Enterprise 22H2
We have a customer who has upgraded from a pretty old version of our software to a more recent one, and they are complaining that a window now takes over 10 minutes to retrieve.
After some investigation I see the actual database retrieves are still relatively fast and in fact the issue is there a call to SetFocus() when the progress bar window is closed. I assume to ensure the main window is brought back to focus when the progress bar is no longer required. This is ancestor code that hasn't been changed for a long, long time.
Commenting this SetFocus() out reduces the the time taken by a little over 10 minutes. I also took out any code in the Activate event in case that is doing something, to no avail, still 10 minutes.
So I ran a Trace using TraceOpen with TraceEnableActivity(ActLine!) etc and I get the following:
Execute tracebegin(ReadOnly string) errorreturn: 0.0000 Execute window.setfocus() integer: 661.1192 Execute 'dw_sheet.getfocus() long: 0.0000 Line 1: 0.0000 := call super::getfocus;//is_last_dw = "DW_SHEET" Execute datawindow.getfocus() long: 0.0000 Line 2: 0.0484 := end event Execute traceend() errorreturn: 0.0001
So, isn't this saying nothing else happened except for the call to SetFocus, which took 661 seconds to complete (it is set to display in seconds)?
Anyone have any tips on how I can track down where the 10 minutes is coming from? Events I should look at, traces I could do?
I could of course just stop the SetFocus being called for this particular window, but I feel like I shouldn't have to.
One thing to note it the datawindow has 165,000 rows in it after retrieval, and this seems to be the reason why SetFocus is taking so long. It's not an issue when there are less rows.
Thanks very much for any help!
agreed, with that number of rows, make sure:
[Data Window]
ACCESSIBILITY=0
is set in the pb.ini in the application's directory