Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
framerate_one_six.mp4
Here's a screenshot in case the video doesn't play in your browser
Firmware 1.7.0
Video of the app running:
framerate_one_seven.mp4
Here's a screenshot in case the video doesn't play in your browser
Firmware 1.7.0-Patched
Video of the app running:
framerate_one_seven_patch.mp4
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