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

Speed up last_status by avoiding wc -l #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stuaxo
Copy link

@stuaxo stuaxo commented Oct 2, 2019

On my system using native bash functions instead of wc -l speeds up the last_status by about 0.2 seconds. This may be because windows pipes are slow or some issue with wc.

Before:

 master
last_status: 0.463
user_info: 0.066
cwd: 0.071
scm: 2.549

After:

last_status: 0.228
user_info: 0.079
cwd: 0.073
scm: 2.714

Performance numbers aren't exact as they vary a bit, but you can see a bit difference in the runtime for last_status.

On my system using native bash functions instead of wc -l speeds up the last_status by about 0.2 seconds.   This may be because windows pipes are slow or some issue with wc.

Before:
```
 master
last_status: 0.463
user_info: 0.066
cwd: 0.071
scm: 2.549
```

After:
```
last_status: 0.228
user_info: 0.079
cwd: 0.073
scm: 2.714
```

Performance numbers aren't exact as they vary a bit, but you can see a bit difference in the runtime for last_status.
@stuaxo stuaxo mentioned this pull request Oct 2, 2019
Last status:  get read to bail out earlier.
Get jobs command to output less by only outputting the pids of stopped jobs.
Speed up last_status further by not using $() around job collection.
Small adjustment to unbreak this :)
AlexiTessierCogecoMedia added a commit to AlexiTessierCogecoMedia/git_bash_windows_powerline that referenced this pull request Feb 19, 2024
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.

None yet

1 participant