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

Optimize engine gauges #68

Open
Maker42 opened this issue Feb 26, 2019 · 2 comments
Open

Optimize engine gauges #68

Maker42 opened this issue Feb 26, 2019 · 2 comments
Assignees

Comments

@Maker42
Copy link
Collaborator

Maker42 commented Feb 26, 2019

The currently checked in engine gauges repaint the entire gauge for every update/paint event in Python. This method has been shown to be very expensive based on profiler data.

If the more static parts of the gauge were in a graphicsview, and only the dynamic parts were repainted, there would likely be a large performance boost.

@birkelbach birkelbach self-assigned this Feb 26, 2019
@birkelbach
Copy link
Contributor

This is on the short list.

@birkelbach
Copy link
Contributor

I've done some experiments with this and I have not been able to get much of a boost. The issue is that the text is expensive to draw in the QGraphicsScene. I got about a 15-20% boost without aligning the text. When I right aligned the text it was actually slower. This was because the position has to be calculated on each update. Without the alignment it wasn't too bad but I couldn't figure out how to right align text without calculating a new position each time the text changes. There might be a way.

There are probably some other optimizations we can do with the QWidget Gauges like making the static things a QPixMap or something instead of drawing them. I'm not sure, but I'll play with it some more.

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

2 participants