Skip to content

Add ripgrep-13.0.0-tiny benchmark #1445

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 1 commit into from
Sep 7, 2022
Merged

Add ripgrep-13.0.0-tiny benchmark #1445

merged 1 commit into from
Sep 7, 2022

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Sep 6, 2022

This should serve as an example of a real-world binary that is optimized for binary size.

Here we can see a disadvantage of the current approach for "special" benchmarks, where we just add a new benchmark and filter unwanted profiles/scenarios - we need to duplicate the code of the benchmark that we want to compile in a special way.

@Kobzol Kobzol requested review from rylev and nnethercote September 6, 2022 21:58
@Mark-Simulacrum
Copy link
Member

I guess it might be worth asking - does ripgrep optimize for small binary size? Or are we just seeing what the compiler can do on a "random" crate?

It seems like user choices here probably matter a great deal, though I have no hard evidence either way.

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 6, 2022

It doesn't, AFAIK. It's more of a test how well does rustc optimize a generic, reasonably sized binary, when you pass it all the available flags. I consider this to be interesting.

FWIW, these are the binary sizes:

Command Size
ripgrep 29 MiB
ripgrep + strip 4.1 MiB
ripgrep-tiny 2.6 MiB

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

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

This seems fine. Are you planning to add any more -tiny benchmarks? I feel like this and helloworld are enough for now. A small one and a larger one seems like enough to evaluate things.

On the code duplication: symbolic links? I guess Windows may be a problem? I found https://stackoverflow.com/a/59761201 it sounds like symlinks with git on Windows is possible, but requires jumping through some hoops, which might not be worthwhile.

@Kobzol
Copy link
Contributor Author

Kobzol commented Sep 7, 2022

I didn't plan to add more at this moment, as you said, one trivial program and one real-world program should be enough for now I think. I'd rather not mess with symlinks in git, I think that it would bring more problems than anything else. I don't think that adding these files is a big problem, it's just something to think about if we were to create a lot of new benchmarks with similar special compilation options.

@Kobzol Kobzol enabled auto-merge September 7, 2022 18:30
@Kobzol Kobzol disabled auto-merge September 7, 2022 20:41
This should serve as an example of a real-world binary that is optimized for binary size.
@Kobzol Kobzol merged commit ff4e6fb into master Sep 7, 2022
@Kobzol Kobzol deleted the ripgrep-tiny branch September 7, 2022 21:11
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.

4 participants