1. Arcady Abramov
  2. PowerBuilder
  3. Wednesday, 9 February 2022 08:32 AM UTC

Hello, all

We are having the following problem.

There is a very complicated window with 48 controls on them. Even when running on a very powerful machine it takes over 1.5 seconds before OpenWithParm function is called and the first line of the first visible constructor is called. We know it because we used runtime logging in code.

It is the same on the first and all consecutive opens of this window 

How can we know what is taking so long, what the system is doing for 1.5 seconds?

We work with PB 2017 R3

Thank you,

Arcady

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 9 February 2022 09:29 AM UTC
  2. PowerBuilder
  3. # 1

Hi, 

You can try the profing  tool and see if you can find out where the 1.5 seconds come from.

EDIT "profing" should be "profiling" (my bad!)

regards

Comment
  1. Miguel Leeuwe
  2. Wednesday, 9 February 2022 13:36 PM UTC
  1. Helpful
  1. Arcady Abramov
  2. Thursday, 10 February 2022 06:45 AM UTC
I am using PB2017 R3. After I create a trace file, I cannot access it from PB. After Profile Trace View tool requires to select my pbt (does it have to be the same PBT?) it PB crashes.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 10 February 2022 08:16 AM UTC
Yes, it has to be the same pbt file.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 9 February 2022 16:25 PM UTC
  2. PowerBuilder
  3. # 2

Hi Arcady, Have disabled accessibility in your PB.INI?

Comment
There are no comments made yet.
Arcady Abramov Accepted Answer Pending Moderation
  1. Sunday, 13 February 2022 08:29 AM UTC
  2. PowerBuilder
  3. # 3

I finally managed to translate the file programmatically (the app was run n the dev machine)

I see the ~1 second difference in the timestamps between the constructor bein and end.

What else can I check?

//-------------------------------------------------------------

 Line 158733: 266719.453320 Create object: w021_reservation_modify
 Line 158806: 266719.454045 Event: w021_reservation_modify.create()(C:\PB_SourceControl\pb2017\PBMainApp\Optima\Optima_Dev\reserv.pbl) 372628036
 Line 158840: 266719.454084 Create object: w021_reservation_modify`st_warning
 Line 158845: 266719.454087 Create object: w021_reservation_modify`st_warning
 Line 158848: 266719.454092 Create object: w021_reservation_modify`st_username
 Line 158853: 266719.454097 Create object: w021_reservation_modify`st_username
 Line 158868: 266719.454140 Create object: w021_reservation_modify`p_lampred
 Line 158873: 266719.454142 Create object: w021_reservation_modify`p_lampred
 Line 158876: 266719.454144 Create object: w021_reservation_modify`p_lampblue
 Line 158881: 266719.454145 Create object: w021_reservation_modify`p_lampblue
 Line 158884: 266719.454147 Create object: w021_reservation_modify`p_lamppink
 Line 158889: 266719.454149 Create object: w021_reservation_modify`p_lamppink
 Line 158892: 266719.454151 Create object: w021_reservation_modify`p_lampgreen
 Line 158897: 266719.454171 Create object: w021_reservation_modify`p_lampgreen
 Line 158900: 266719.454174 Create object: w021_reservation_modify`pb_save
 Line 158907: 266719.454180 Create object: w021_reservation_modify`pb_save
 Line 158912: 266719.454182 Create object: w021_reservation_modify`pb_fax
 Line 158919: 266719.454185 Create object: w021_reservation_modify`pb_fax
 Line 158924: 266719.454187 Create object: w021_reservation_modify`pb_ok
 Line 158931: 266719.454189 Create object: w021_reservation_modify`pb_ok
 Line 158936: 266719.454190 Create object: w021_reservation_modify`pb_more
 Line 158943: 266719.454193 Create object: w021_reservation_modify`pb_more
 Line 158948: 266719.454207 Create object: w021_reservation_modify`pb_cancel
 Line 158955: 266719.454212 Create object: w021_reservation_modify`pb_cancel
 Line 158960: 266719.454214 Create object: w021_reservation_modify`p_wakeup
 Line 158965: 266719.454234 Create object: w021_reservation_modify`p_wakeup
 Line 158968: 266719.454236 Create object: w021_reservation_modify`pb_pro_invoice
 Line 158975: 266719.454239 Create object: w021_reservation_modify`pb_pro_invoice
 Line 158980: 266719.454243 Create object: w021_reservation_modify`st_internet
 Line 158987: 266719.454246 Create object: w021_reservation_modify`st_internet
 Line 158992: 266719.454249 Create object: w021_reservation_modify`pb_attachments
 Line 158999: 266719.454252 Create object: w021_reservation_modify`pb_attachments
 Line 159004: 266719.454254 Create object: w021_reservation_modify`pb_benefits
 Line 159011: 266719.454258 Create object: w021_reservation_modify`pb_benefits
 Line 159016: 266719.454260 Create object: w021_reservation_modify`st_main_title
 Line 159021: 266719.454262 Create object: w021_reservation_modify`st_main_title
 Line 159024: 266719.454302 Create object: w021_reservation_modify`cbx_1
 Line 159031: 266719.454307 Create object: w021_reservation_modify`cbx_1
 Line 159036: 266719.454342 Create object: w021_reservation_modify`dw_header
 Line 159049: 266719.454431 Create object: w021_reservation_modify`dw_header
 Line 159054: 266719.454434 Create object: w021_reservation_modify`pb_companions
 Line 159059: 266719.454437 Create object: w021_reservation_modify`pb_companions
 Line 159062: 266719.454438 Create object: w021_reservation_modify`dw_account_icons
 Line 159069: 266719.454443 Create object: w021_reservation_modify`dw_account_icons
 Line 159074: 266719.454444 Create object: w021_reservation_modify`dw_page_count
 Line 159079: 266719.454459 Create object: w021_reservation_modify`dw_page_count
 Line 159082: 266719.454462 Create object: w021_reservation_modify`uo_more
 Line 159281: 266719.454711 Create object: w021_reservation_modify`uo_more
 Line 159286: 266719.454714 Create object: w021_reservation_modify`pb_task
 Line 159291: 266719.454732 Create object: w021_reservation_modify`pb_task
 Line 159294: 266719.454736 Create object: w021_reservation_modify`pb_notes
 Line 159299: 266719.454772 Create object: w021_reservation_modify`pb_notes
 Line 159302: 266719.454775 Create object: w021_reservation_modify`st_countdown
 Line 159307: 266719.454777 Create object: w021_reservation_modify`st_countdown
 Line 159310: 266719.454782 Create object: w021_reservation_modify`st_cust_points
 Line 159315: 266719.454784 Create object: w021_reservation_modify`st_cust_points
 Line 159318: 266719.454788 Create object: w021_reservation_modify`st_comments
 Line 159323: 266719.454790 Create object: w021_reservation_modify`st_comments
 Line 159326: 266719.454792 Create object: w021_reservation_modify`pb_crm
 Line 159333: 266719.454798 Create object: w021_reservation_modify`pb_crm
 Line 159338: 266719.454800 Create object: w021_reservation_modify`dw_confirm_card
 Line 159343: 266719.454801 Create object: w021_reservation_modify`dw_confirm_card
 Line 159346: 266719.454804 Create object: w021_reservation_modify`dw_detail
 Line 159433: 266719.457330 Create object: w021_reservation_modify`dw_detail
 Line 159438: 266719.457334 Create object: w021_reservation_modify`dw_policy
 Line 159443: 266719.457336 Create object: w021_reservation_modify`dw_policy
 Line 159446: 266719.457339 Create object: w021_reservation_modify`dw_credit
 Line 159453: 266719.457344 Create object: w021_reservation_modify`dw_credit
 Line 159458: 266719.457346 Create object: w021_reservation_modify`dw_features
 Line 159465: 266719.457350 Create object: w021_reservation_modify`dw_features
 Line 159470: 266719.457351 Create object: w021_reservation_modify`dw_made_by
 Line 159475: 266719.457353 Create object: w021_reservation_modify`dw_made_by
 Line 159478: 266719.457355 Create object: w021_reservation_modify`dw_wakeups
 Line 159483: 266719.457369 Create object: w021_reservation_modify`dw_wakeups
 Line 159486: 266719.457371 Create object: w021_reservation_modify`dw_flight_package_confirmation
 Line 159491: 266719.457373 Create object: w021_reservation_modify`dw_flight_package_confirmation
 Line 159494: 266719.457407 Create object: w021_reservation_modify`dw_guest_preferences
 Line 159499: 266719.457410 Create object: w021_reservation_modify`dw_guest_preferences
 Line 159502: 266719.457413 Create object: w021_reservation_modify`dw_meal_plan
 Line 159515: 266719.457479 Create object: w021_reservation_modify`dw_meal_plan
 Line 159520: 266719.457481 Create object: w021_reservation_modify`dw_meals_consumption
 Line 159525: 266719.457507 Create object: w021_reservation_modify`dw_meals_consumption
 Line 159528: 266719.457510 Create object: w021_reservation_modify`dw_dates
 Line 159535: 266719.457515 Create object: w021_reservation_modify`dw_dates
 Line 159540: 266719.457516 Create object: w021_reservation_modify`dw_services
 Line 159547: 266719.457523 Create object: w021_reservation_modify`dw_services
 Line 159552: 266719.457524 Create object: w021_reservation_modify`uo_printers
 Line 159587: 266719.457577 Create object: w021_reservation_modify`uo_printers
 Line 159592: 266719.457580 Create object: w021_reservation_modify`dw_companions
 Line 159597: 266719.457589 Create object: w021_reservation_modify`dw_companions
 Line 159600: 266719.457591 Create object: w021_reservation_modify`uo_buttons
 Line 159987: 266719.458335 Create object: w021_reservation_modify`uo_buttons
 Line 159992: 266719.458339 Create object: w021_reservation_modify`dw_deposit
 Line 159997: 266719.458341 Create object: w021_reservation_modify`dw_deposit
 Line 160000: 266719.458344 Create object: w021_reservation_modify`uo_mini_buttons
 Line 160189: 266719.458567 Create object: w021_reservation_modify`uo_mini_buttons
 Line 160194: 266719.458571 Create object: w021_reservation_modify`dw_features_request
 Line 160199: 266719.458572 Create object: w021_reservation_modify`dw_features_request
 Line 160202: 266719.458630 Create object: w021_reservation_modify`uo_deposit
 Line 160259: 266719.458842 Create object: w021_reservation_modify`uo_deposit
 Line 160264: 266719.458845 Create object: w021_reservation_modify`dw_preferences
 Line 160269: 266719.458846 Create object: w021_reservation_modify`dw_preferences
 Line 160370: 266719.459041 Event: w021_reservation_modify.create()(C:\PB_SourceControl\pb2017\PBMainApp\Optima\Optima_Dev\reserv.pbl) 372628036
 Line 160372: 266719.459041 Create object: w021_reservation_modify
 Line 160523: 266720.316272 Event: w021_reservation_modify`pb_save.constructor() long(C:\PB_SourceControl\pb2017\PBMainApp\Optima\Optima_Dev\reserv.pbl) 372625116

//-----------------------------------------------------------

Comment
  1. Chris Pollach @Appeon
  2. Sunday, 13 February 2022 15:41 PM UTC
With those many controls on a window, I'm not surprised about the 1.5 seconds instantiation time.

Basically, the design of that window is 50+ handles. Each window handle requires expensive O/S control blocks to be allocated. I would replace all those native controls with a DataWindow. All those controls within a DWO are one MS-Windows handle. What you have now is a window that requires a to n of O/S resources to be allocated. That is the reason I never use native controls where possible. Instead DWO's all the way. Food for thought.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Sunday, 13 February 2022 16:40 PM UTC
I agree with Chris. We have a specific window in which the programmer thought it was a good idea to have 32 dw controls. (I think you have 31). When opening the window in the IDE (not running the app), powerbuilder would simply blow up. What I had to do, was assign the dataobjects in the constructor events, instead of having them pre-assigned in the controls. At least now we can open the window, but it's still very bad practice.

You should re-design that window, using user objects and like Chris already said maybe a datawindow for all the p_ and pb_ controls.

regards.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.