Bug 2711

Update of computed fields on mousemove event does cost a lot of performance 02 December, 2020

Constantin Bergatt
10 May, 2019
Product: PowerBuilder Category: DataWindow
Version: 2017 R3 Build:
Classification: Publishing: Public
Priority: P3
Status: Verifying Reason:
Communication Status: Waiting for Appeon
Constantin Bergatt 02 December, 2020
#16
Hi Ken,

many, many thanks!

Please keep me updated on their decision / progress.

Regards,
Constantin
Ken Guo @Appeon 01 December, 2020
#15
Hi Constantin,

I have submitted it to the development team. As for whether we will modify this PB logic, it will depend on the developers to decide after comprehensive analysis.


Regards,
Ken
Constantin Bergatt 01 December, 2020
#14
Hi Ken,

instead of fixing an old legacy issue, that could potentially increase the performance of all PowerBuilder applications for all your customers, you opt for not fixing it, as some customers might or might not have used it for the wrong purposes? The solution for the customers, who did use this mechanic, should be very simple. Just move the required functionality to the "mouse move" event of your data window. As it should be the normal way. From my point of view as a programmer, I would not even think of trying to solve my problem that way, just because there is a proper event to handle such things.

Could you please ask the developer / product team to reconsider this issue?

Regards,
Constantin
Ken Guo @Appeon 27 November, 2020
#13
Hi Constantin,

Currently, Appeon doesn’t have a plan to modify this PB logic. This logic exists in PB a long time ago and other customers might have used it.

So it is recommended you try to use the workaround to disable the Slide Left property of the TEXT object. In this way, it sharply reduces the times of calls to Global Function.
Steps:
1. Open DW, click menu Edit -> Select -> Select Text
2. In the Properties window, select Position Tab, uncheck the Slide Left property.

Besides, it is not suggested you use global functions that need to call the database heavily in that it will affect the performance. You can also consider using the read cached data method instead of calling the database.


Regards,
Ken
Constantin Bergatt 26 November, 2020
#12
Hi Ken,

many thanks for your reply and the provided test application!

It is amazing, how deactivating "Slide Left" and the removal of "Groupboxes" can reduce the number of calls to the global function by that much.

Unfortunately we currently don't have the man power to apply your workarounds to our application, as we are struggling with other pressing matter. And there is still no relief in sight.

Therefore I would still like to see the issue itself fixed, if necessary also long-term. This would help us greatly improve the performance of our application.

Many thanks for all your efforts!

Regards,
Constantin
Ken Guo @Appeon 26 November, 2020
#11
Appeon Workaround

Hi Constantin,

Our development team deeply analyzed this issue recently and finally decided not to modify the current logic because modifying it would affect other users.
However, we found out two workarounds, see the attachment.

Workaround 1: Set the Slide Left property of the Text object in DW to False, this way you will find it significantly reduces the times of calling Global Function to about 1/10 of the times it previous calls.

Workaround 2: If you deleted all group box objects in the DW after workaround 1, the times of calling Global Function is almost reduced to 0.

Hope the above workarounds could help.

Regards,
Ken
Constantin Bergatt 23 November, 2020
#10
Hi Ken,

many thanks for your efforts!

Regards,
Constantin
Ken Guo @Appeon 23 November, 2020
#9
Hi Constantin,

Thanks for your feedback.
I will let our development team know your situation again and keep you posted on the update. 


Regards,
Ken
Constantin Bergatt 23 November, 2020
#8
Hi Ken,

thanks a lot for your inquiry!

No, the issue still persists. As we have a very complex application with lots of datawindows, working around the issue would mean a huge amount of effort, which is currently jus not possible due to a very tight and ambitious schedule well into the next year.

Therefore any progress on this issue is much appreciated, as it would help us greatly with the user experience.

Regards,
Constantin
Ken Guo @Appeon 20 November, 2020
#7
Hi Constantin,

I would like to check with you if the response provided has been helpful enough
to resolve your case. If so, can we proceed to close the ticket?


Regards,
Ken
Ken Guo @Appeon 22 May, 2019
#6
Hi Constantin,

I can understand what you are saying. If PB don’t refresh the DW UI when moving the mouse, then the performance will definitely be much faster, especially when the calculation column contains any global function.
I will submit your issue to the development team to see if they will modify it after analysis.
According to our experience, it is generally not easy to make modifications for such issues because it may cause some other functionality losses.

Regards,
Ken
Ken Guo @Appeon 22 May, 2019
#5
Hi Constantin,

I can understand what you are saying. If you don’t refresh the DW UI when moving the mouse, then the performance will definitely be much faster, especially when the calculation column contains any global function.
I will submit your issue to the development team to see if they will modify it after analysis.
According to our experience, it is generally not easy to make modifications for such issues because it may cause some other functionality losses.

Regards,
Ken
Constantin Bergatt 22 May, 2019
#4
Hi Ken,

I see your point. But I'm still asking myself is it really necessary?

I mean the number of cases an automatic update of computed columns on a mouse move event should be very limited (at least from my point of view). Plus there is always the possibility to realize the required behavior by coding it within the mouse move event of the datawindow itself (e.g.: using a static label for the mouse position / current object the mouse is hovering over and update its value accordingly on the mouse move event).

Further, this may have a positive impact on the PowerBuilder runtime / applications itself as it will decrease the number of updates on computed fields significantly.

Best regards,
Constantin Bergatt
Ken Guo @Appeon 13 May, 2019
#3
Hi Constantin,

It is a normal phenomenon.
When moving the mouse pointer, a DataWindow needs to be re-painted, especially the computed fields, because they might involve some contents that need to be computed in real time, e.g. the mouse position, the object name the current mouse is over, etc.

In your DW, the global function is called in many areas so every time when you move the mouse pointer, the global function will be called multiple times.

If you want to improve the performance, you can only reduce the number of calls of the global function or improve the global function content so that it can execute less code. 

Regards,
Ken
Constantin Bergatt 10 May, 2019
#2
Bug #2711 TestApp.7z (26KB)

Hi Ken,

thanks a lot for the quick follow-up!

Please find attached a small test application. In this application you'll find one of our "problem" datawindows. When moving the mouse pointer all across the datawindow a global function is called which will update a counter on the window of the test application.

Regards,
Constantin
Ken Guo @Appeon 10 May, 2019
#1
Hi Constantin,

Could you please create a small case (includes PBT/PBL) about Demo DB and then send it for us? With your case, we can solve this issue more effectively. 
Appreciate your understanding.

Regards,
Ken
Constantin Bergatt 10 May, 2019
*Phenomenon:
During research for some performance issue of our application, it was found that whenever the mouse pointer is moving over a datawindow the contained computed columns are recalculated every time the mouse pointer changes position.
As we called some global translation functions within these computed columns, which will consequently access our database for some data, we experienced a big decrease in performance when hovering over the datawindow with the mouse pointer.
It seems to us, that whenever a mousemove event is triggerd also all computed columns are updated.

From our point of view, this is not really required. As the user still have the possibility to code functionality into the mousemove event explicitly, if he requires to change data based on the position of the mouse pointer.

*Reproduce Steps:
Create a small test application with a datawindow which will contain a computed field which calls a global function.
For our case we created a global function which created windows debug messages. When now starting the application and moving the mouse pointer over the datawindow, a lot of debug messages will be created.

Remarks:
OS:
Windows 10
Platform:
All
Database Type:
SAP SQL Anywhere
Database Version:
17.0.9.4882