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

Improve prompt rendering upon pressing enter (i.e beyond startup) #18

Open
p4vook opened this issue Jan 7, 2020 · 2 comments
Open

Improve prompt rendering upon pressing enter (i.e beyond startup) #18

p4vook opened this issue Jan 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@p4vook
Copy link

p4vook commented Jan 7, 2020

Hello!
Happy new year)
I realized that

echo -n

benchmarking command is bad, because as seems to me, it does not render PS1. I held enter, recorded screen and saw, that rendering takes about 6 frames (look at frames 243-249), which is about 85 ms (framerate is 70 FPS). And I think, it's the reason to borrow some stuff from powerlevel10k.
(the original video may be found here)
recording

@petobens
Copy link
Owner

petobens commented Jan 8, 2020

Yeah I tried using https://github.com/romkatv/zsh-prompt-benchmark but it's for zsh only. When I wrote trueline I tried to optimize startup time rather than this scenario described in your video. Let's leave this open then and I'll try to tackle it (no idea when though). Thanks for the report (feel free to open a PR if you get to this before I do)

@p4vook
Copy link
Author

p4vook commented Jan 9, 2020

My friend told me another way of benchmarking: copy and paste this script into bash:

start=$(date +"%s.%N")































































































end=$(date +"%s.%N")
printf "print(($end - $start) / 100)" | python3

This is accurate. I get about 65 ms when my processor runs 4 GHz, if it's frequency is about 900 MHz (typical battery saving), I get about 175 ms.

@petobens petobens added the enhancement New feature or request label Jan 13, 2020
@petobens petobens changed the title Not actually so fast (new benchmark) Improve prompt rendering upon pressing enter (i.e beyond startup) Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants