Skip to content

runplus: optimise UI rendering #3810

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

Merged
merged 6 commits into from
Apr 23, 2025
Merged

Conversation

bobrippling
Copy link
Collaborator

@bobrippling bobrippling commented Apr 18, 2025

Only redraw layout if we might've shown a setRecording prompt

bobrippling and others added 6 commits April 18, 2025 14:28
timings for start/stop:
13:38:15.996Z: onStartStop()
13:38:16.006Z: setRecording()
13:38:16.728Z: setRecording() done
13:38:16.732Z: layout.render()
13:38:17.154Z: layout.render() done
13:38:17.157Z: exs.start/stop/resume()
13:38:17.161Z: exs.start/stop/resume() done
13:38:17.462Z: setStatus()

13:38:19.027Z: onStartStop()
13:38:19.199Z: exs.start/stop/resume()
13:38:19.202Z: exs.start/stop/resume() done
13:38:19.495Z: setStatus()

13:38:24.795Z: onStartStop()
13:38:24.805Z: setRecording()
13:38:25.483Z: setRecording() done
13:38:25.487Z: layout.render()
13:38:25.913Z: layout.render() done
13:38:25.915Z: exs.start/stop/resume()
13:38:25.919Z: exs.start/stop/resume() done
13:38:26.218Z: setStatus()

13:38:27.842Z: onStartStop()
13:38:28.010Z: exs.start/stop/resume()
13:38:28.012Z: exs.start/stop/resume() done
13:38:28.309Z: setStatus()

in summary:
setRecording: ~700ms
layout.render(): ~420ms
@thyttan
Copy link
Collaborator

thyttan commented Apr 20, 2025

Seems to work ok when I try it! Not sure what the functional change is just from a user perspective?

It's not this PR's fault but i get in Web IDE:
WIDGETS["recorder"].setRecording is deprecated. Use require("recorder").setRecording instead.

Maybe we change that in another PR later on.

@bobrippling
Copy link
Collaborator Author

bobrippling commented Apr 22, 2025

Thanks! Yes no functional change, just a slightly faster response when the user wants to start their run (if they don't have the recorder app installed).

I'd notice it takes almost a second to draw, which doesn't give me confidence that runplus has started recording, but at the same time I don't want to be hanging about at the start line! So I've been attempting to speed things up

(and agreed, r.e. another change for the deprecation)

@thyttan thyttan merged commit 7010410 into espruino:master Apr 23, 2025
1 check passed
@bobrippling bobrippling deleted the feat/run-ui-opt branch April 23, 2025 07:14
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.

2 participants