Questions? Feedback?powered byOlark live chat software
Bug 2711

Update of computed fields on mousemove event does cost a lot of performance 22 May, 2019

Constantin Bergatt
10 May, 2019
Product: PowerBuilder Category: DataWindow
Version: 2017 R3 Publishing: Public
Status: Verifying Priority: P3
Classification: Resolution:
Ken Guo 22 May, 2019
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 22 May, 2019
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
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 13 May, 2019
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
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 10 May, 2019
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