findobj severely degrades run time performance in Scilab 6.1.1
@perrichonpierre58)
Reported by pierre perrichon (BUG DESCRIPTION:
----------------
I wrote, some time ago, a GUI to calculate the servo parameters of a speed regulator.
The main page of this GUI is in attached file OptSim - Main Page.pdf.
It mainly contains 46 uicontrol and 25 tags approximativelly.
This program has been developped with Scilab 5.5.2, run perfectly and is robust
For my test :
When the operator press the PID Button, fields from Head to Kd are recolorized in gray or orange. So there is 11 tags to find to do that in a loop.
That's all. See the program in attached file "function Colorize_PID__Button..sci"
With Scilab 5.5.2, it takes 40 ms (tic-toc)
With Scilab 5.5.2, it takes 8 s
Of course, others opérations become degrated.
ERROR LOG:
----------
In scilab 6.1.1, sometimes, but rather rarely, I get on the console :
à la ligne 11 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 67 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 40 de la fonction findobj ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 53 )
Or
à la ligne 11 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 67 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 19 de la fonction findMatchingChild ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 75 )
à la ligne 40 de la fonction findobj ( C:\Program Files\scilab-6.1.1\modules\gui\macros\findobj.sci ligne 53 )
HOW TO REPRODUCE THE BUG:
-------------------------
OTHER INFORMATION:
------------------
WORKAROUND TO TEMPORARY SOLVE THE PROBLEM :
I've copied findobj.sci from scilab 5.5.2 to findobj5.sci, rename functions :
1) function h = findobj5(propertyName, propertyValue)
2) function hFound = findMatchingChild5(children, propertyName, propertyValue)
3) recreate the function cmpi which has disappeared
Then I load file findobj5 in an appropriate pwd at run time
When PID is pressed on, I run the program with findobj5 (from scilab 5.5.2) and findobj (scilab 6.1.1) else.
Here are the results
29/07/2021 - 17:31:48 ==> Run with findobj5 Scilab 5.5.2
Durée de la fonction Colorize_PID__Button : 0.216 s
29/07/2021 - 17:32:02 ==> Run with findobj Scilab 6.1.1
Durée de la fonction Colorize_PID__Button : 8.505 s
Normally, my intention is to continue with my patch, until findobj give better results.
Sincerely
Edited by scilab bot