Skip to content

hotfix/perf(#331): removes padding on list-remote output#333

Merged
MordechaiHadad merged 2 commits into
MordechaiHadad:masterfrom
MrDwarf7:hotfix/padding-removal
Oct 13, 2025
Merged

hotfix/perf(#331): removes padding on list-remote output#333
MordechaiHadad merged 2 commits into
MordechaiHadad:masterfrom
MrDwarf7:hotfix/padding-removal

Conversation

@MrDwarf7

Copy link
Copy Markdown
Contributor

Summary

Removal of padding when calling bob list-remote

The padding variable and associated usage in the list_remote_handler.rs file have been removed.

Performance change

There's no need to request an io::stdout lock any early than the moment we require output.
To achieve this I've used a Vec::with_capacity(1024) via a buffer (basically a char buffer).
Outputting to this via writeln!(...) and only calling the io::stdout().lock() after the if-else chain.

I've also implemented explicit error output handling for io::ErrorKind::BrokenPipe and added proper flushing for the stdout lock.

Removal of padding variable and 
associated usage in list-remote command
output formatting.
This also moves the syscall for requesting 
the stdout lock to be as late as possible in 
the current stack frame, to minimize overhead.
@MrDwarf7

Copy link
Copy Markdown
Contributor Author

Closes the associated issue (#331).
Good to go @MordechaiHadad when you're able to merge 😄

Comment thread src/handlers/list_remote_handler.rs
Comment thread src/handlers/list_remote_handler.rs Outdated
@MrDwarf7 MrDwarf7 force-pushed the hotfix/padding-removal branch from 1c4e033 to cf86210 Compare October 13, 2025 10:23
@MordechaiHadad MordechaiHadad linked an issue Oct 13, 2025 that may be closed by this pull request
@MordechaiHadad MordechaiHadad merged commit d660c74 into MordechaiHadad:master Oct 13, 2025
21 checks passed
@MrDwarf7 MrDwarf7 deleted the hotfix/padding-removal branch October 13, 2025 10:55
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.

Listing remote versions yields lines with leading spaces

2 participants