Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of motors: optimize startup performance of OPI-based ToM #5320

Closed
Tom-Willemsen opened this issue Mar 12, 2020 · 8 comments
Closed

Table of motors: optimize startup performance of OPI-based ToM #5320

Tom-Willemsen opened this issue Mar 12, 2020 · 8 comments

Comments

@Tom-Willemsen
Copy link
Contributor

Tom-Willemsen commented Mar 12, 2020

As an instrument scientist I do not want to have performance regressions in the table of motors.

We are trying to move to an OPI-based ToM in #4633 . As noted in the comments of that ticket, the performance of the OPI based solution is about 3x slower than the java-based implementation that we had previously when initially opening the ToM.

Possible solutions:

  • Reduce the number of scripts within the OPI by doing the logic in java code and writing to a CSS local PV
  • See also Dom's comment below

Acceptance criteria:

  • The performance of opening the OPI based ToM on an instrument-like machine (e.g. DEMO or SCIDEMO) is comparable to the previous performance of the java based solution.
@DominicOram
Copy link
Contributor

Possible things that could help:

  • Reduce the number of scripts/rules
  • Use one large OPI rather than linking containers
  • Create a motor widget in CSS
  • Use threading in any scripts

@Tom-Willemsen
Copy link
Contributor Author

Initial investigation:

  • Scripts/rules don't appear to be the primary issue - I tried completely removing all of the scripts and rules and only saw a minor performance increase.
  • I tried copying widgets into the top-level OPI rather than using linking containers - this had no effect as far as I could tell.
    • These were also all pointing at the same motor, so I don't think the underlying PV connections are what is taking the time here.
  • I tried substituting the grid layout for a row based mechanism, in case CSS was taking a long time calculating a layout. This did not significantly change the performance.
  • I removed half of the motor widgets in the table of motors and the performance became ~2x better
    • With a single motor widget on screen performance was good

This leads me to believe that the primary performance issue here is the sheer number of widgets being drawn.

@John-Holt-Tessella
Copy link
Contributor

John-Holt-Tessella commented Mar 20, 2020

Is this inside a linking container? If you remove them from the linking container is it better?
If you remove the icons is it better?
We have lots of labels on the reflectometry page and that doesn't seem so bad. I am not sure how many though. (No icons)

@Tom-Willemsen
Copy link
Contributor Author

Tom-Willemsen commented Mar 20, 2020

Is this inside a linking container?

No, in point 2 above I removed all linking containers and copied them into the top level, this had little to no performance impact

If you remove the icons is it better?

If I remove the 5 icon widgets for each motor the performance becomes 2x better, which is in line with the performance being based on total number of widgets.

We have lots of labels on the reflectometry page and that doesn't seem so bad.

For comparison:
Eurotherm: 58 widgets
ICE fridge (with complex schematic): 92 widgets
Reflectometry front panel: 135 widgets
CS-Studio "large" performance test: 200 widgets
Table of motors OPI: 674 widgets

@John-Holt-Tessella
Copy link
Contributor

Ahhh, ok, brilliant. OK unless anyone else has a better plan I think it is back to Java. But I feel we have learned something.

@DominicOram
Copy link
Contributor

If we create a specific motor widget in CSS we could cut the number of widgets down significantly

@Tom-Willemsen
Copy link
Contributor Author

@DominicOram yes, that's the approach I was thinking of taking to continue onwards with this ticket.

@Tom-Willemsen
Copy link
Contributor Author

Tom-Willemsen commented Mar 31, 2020

In a discussion with @ThomasLohnert and @DominicOram about different ways of implementing this in CSS, we have come to the conclusion that we should go back to a java-based table of motors for now.

I'll write up what we found in this ticket on the wiki.

Edit: added at https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/OPI-programming-tips-and-limitations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants