Skip to content

command screen: fill current line when scanning#185

Merged
cgzones merged 1 commit intohtop-dev:masterfrom
ryenus:cmd-scr
Sep 29, 2020
Merged

command screen: fill current line when scanning#185
cgzones merged 1 commit intohtop-dev:masterfrom
ryenus:cmd-scr

Conversation

@ryenus
Copy link
Copy Markdown
Contributor

@ryenus ryenus commented Sep 28, 2020

After pr #67 got merged, @BenBE proposed the option to fill the current line
while scanning the command, rather than using a separate memcpy afterward.
So I gave it a try and measured the difference.

For short commands there's not much difference, but when a command is relatively
long, e.g., the longest I could find, of a java process, is about 7k+
characters, per my test, in the best case, it's about 30 vs 28 (ms) on average
before and after, So the copy-on-scan approach won with a little margin.

@ryenus
Copy link
Copy Markdown
Contributor Author

ryenus commented Sep 28, 2020

@cgzones would you please take a look?

Nevertheless the numbers are machine specific, YMMV.

Copy link
Copy Markdown
Member

@cgzones cgzones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Don't quite like the back-addressing in p - line_offset, but overall it's okay nonetheless.

@cgzones cgzones merged commit 214c742 into htop-dev:master Sep 29, 2020
@ryenus ryenus deleted the cmd-scr branch September 29, 2020 12:36
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.

3 participants