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

set_buffer is slow #18

Open
LoganDark opened this issue Jun 14, 2022 · 6 comments
Open

set_buffer is slow #18

LoganDark opened this issue Jun 14, 2022 · 6 comments
Labels
bug Something isn't working Needs Design Work Win32

Comments

@LoganDark
Copy link

On Windows 10, set_buffer can take upwards of 15-20 ms, which is noticeably slow.

Perhaps a no-copy API could be introduced to mitigate this.

john01dav pushed a commit that referenced this issue Dec 22, 2022
Add feature flags for `x11` and `wayland`
@john01dav john01dav added bug Something isn't working Win32 Needs Design Work labels Dec 23, 2022
@ids1024
Copy link
Member

ids1024 commented Jan 10, 2023

20 ms is pretty bad, since that gives you less that 60fps just calling set_buffer, before accounting for time spent actually rendering.

With some quick testing, I don't seem to see worse than around 1.5ms. Presumably a 4k buffer would take longer, though not by this much. Not sure how much difference CPU/memory/GPU speed/etc would have here.

If anyone is currently seeing performance like this with softbuffer on Windows or any other backend, I'd like to know exactly in what circumstances it's reproducible.

@hecrj
Copy link

hecrj commented Apr 5, 2023

@ids1024 I am getting 50ms on average to present a 4k window on macOS with the advanced-text branch of iced. I'm using an Intel i9 MacBook from 2019.

I can also reproduce the issue with just the animation example.

@ids1024
Copy link
Member

ids1024 commented Apr 5, 2023

#65 should improve performance on some platforms, though on macOS that's currently limited to the same approach.

#83 mentions a possible approach on macOS. I'd be happy to hear if anyone familiar with ABIs like this on macOS/iOS thinks this is a viable/ideal solution.

@LoganDark
Copy link
Author

LoganDark commented Aug 25, 2023

Now that I've had the opportunity to test softbuffer 0.3.0 with managed buffers, I can confirm that drawing a new frame into a 4K buffer can now be done in under 6ms on win32 (10ms in debug mode). I consider this issue solved on Windows :)

@notgull notgull closed this as completed Aug 25, 2023
@LoganDark
Copy link
Author

LoganDark commented Aug 25, 2023

I left this open because my impression was that presenting is still slow on macOS (arguably more common since basically every Mac has a HiDPI display)

@notgull
Copy link
Member

notgull commented Aug 25, 2023

Oh, my bad

@notgull notgull reopened this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs Design Work Win32
Development

No branches or pull requests

5 participants