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

4729 buffering implementation in the SWT implementation of the canvas. #4789

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

saulhidalgoaular
Copy link
Collaborator

Fix #4729

@saulhidalgoaular
Copy link
Collaborator Author

Buffer enabled
4729_bufered

Buffer disabled
4729_non_buffered

@IanMayo
Copy link
Member

IanMayo commented Feb 13, 2020

@helenayele - we need to test this is ok in Snail Mode, and that range rings & dynamic shapes work ok.

Copy link
Collaborator

@helenayele helenayele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this fix, I its performance is improved see this video :
https://screencast-o-matic.com/watch/cYn2jFwxSW

But @IanMayo can you give me a little detail steps when you say test in Snail mode and also range ring..
Because a little confused since in Snail mode we can't see the track segments so can't test this.

@IanMayo
Copy link
Member

IanMayo commented Feb 14, 2020

Hello @helenayele - sure.

Saul is now double-buffering the image. So, we take a "snapshot" of the plot image, and use that when we do some repaint operations. We only create a new "snapshot" when data changes (or something like that).

So, we need to test that the snapshot doesn't get overwritten (or mangled) when Debrief is doing something dynamic, when lots of things are being repainted. Snail mode and moving range rings are examples of the plot changing, but without making edits to the underlying data.

helenayele
helenayele previously approved these changes Feb 14, 2020
Copy link
Collaborator

@helenayele helenayele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected so approving..

@IanMayo
Copy link
Member

IanMayo commented Feb 14, 2020

I've got an issue. Maybe it's just MACOS:

  1. Load mid_flow2b.dpf
  2. Fit to window
  3. Try to drag the short purple TMA leg
  4. The background disappears during the drag operation

screencast

@saulhidalgoaular
Copy link
Collaborator Author

This is how it looks with that file on Linux and Windows.
Linux:
4729_linux
Windows:
4729_windows

@IanMayo
Copy link
Member

IanMayo commented Feb 15, 2020

Yes, @saulhidalgoaular - I think we need to use an operating system check to prevent using the double-buffering trick on MACOS.

Copy link
Collaborator

@helenayele helenayele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In windows, it was working before this fix, and also it works fine in this fix :

Image from Gyazo

@IanMayo
Copy link
Member

IanMayo commented Feb 17, 2020

Helen - do you see a performance improvement in Windows? Is it much slower on develop?

@helenayele
Copy link
Collaborator

Yes, in develop it is much slower than the current fix, but still it is not that much fast as it is seen in Saul videos in MS window.
In Current fix , it looks like :
Image from Gyazo

In develop:
Image from Gyazo

@IanMayo
Copy link
Member

IanMayo commented Feb 18, 2020

Have compared performance with/without buffering, under MS Windows. With buffering disabled:

Elapsed:89
Elapsed:84
Elapsed:81
Elapsed:83
Elapsed:79
Elapsed:79
Elapsed:78

Switch buffering on:

Elapsed:19
Elapsed:10
Elapsed:14
Elapsed:8
Elapsed:15
Elapsed:10
Elapsed:14
Elapsed:9

But, there's certainly some other expensive operation going on - since we're not getting 10ms update rates - it feels more like 500ms updates.

@IanMayo
Copy link
Member

IanMayo commented Feb 18, 2020

Ok, I've had a look in YourKit:
image

It's taking 6 times longer to draw the stacked dots than the plot. Our double-buffering has reduced the smaller operation by about 80%, but the expensive operation is still running.

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

Successfully merging this pull request may close these issues.

Optimise UI performance when dragging TMA tracks
3 participants