Closed mbooth101 closed 3 months ago
Hi @mbooth101!
Thank you for the test app, also. This is really handy :)
Hi, I didn't notice there was already a PR for this sorry for the noise!
Yes your implementation is fine -- I didn't want to mess to the on_top stack in case there was a reason it was separate. Feel free to merge your change and close this one :-)
Will do. I've also applied a change to the framebuffer ram location that gets us another 18% or so.
Description
Since firmware 1.7.0 I noticed a performance regression. I wrote a simple app that does nothing except show the framerate and the time-per-frame on screen. Compare badge Firmwares 1.6.0 versus 1.7.0 in the footage below.
As you can see from the video, I've experienced a drop from around 10 fps to 8fps, which as a percentage, is quite significant.
Whilst investigating this, one potentially very low hanging optimisation fruit I found would be to avoid rendering all the applications in the foreground stack. Since the first thing every app does at the start of the render loop is clear the framebuffer, the top-most app in the stack will overwrite everything rendered by all the other apps below it in the stack.
The change I'm proposing in this PR renders only the top-most app in the foreground apps stack. This completely eliminates the time spend rendering the launcher (and any other app that happens to be in the stack) and more or less halves the time taken for the end_frame step because the ctx drawlists are much shorter. No change is made to the rendering behaviour of the always on top stack of apps.
This yields a noticeable improvement in the framerate of tildagon apps with realtime graphics. You can see from the Firmware 1.7.0-Patched footage below that the test app now consistently achieves around ~14 fps.
Firmware 1.6.0
Video of the app running:
https://github.com/emfcamp/badge-2024-software/assets/597661/af60f584-b4cb-4052-bb02-2889086d781f
Here's a screenshot in case the video doesn't play in your browser
Firmware 1.7.0
Video of the app running:
https://github.com/emfcamp/badge-2024-software/assets/597661/95ca5a27-7670-4e0c-9b9c-e669440a8869
Here's a screenshot in case the video doesn't play in your browser
Firmware 1.7.0-Patched
Video of the app running:
https://github.com/emfcamp/badge-2024-software/assets/597661/9795e896-618c-41cb-9152-0991a6f689ed
Here's a screenshot in case the video doesn't play in your browser
Test App Source
For reference this is the source of the app I am using to show the framerate