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

Quantify benefit in the readme #2

Open
dtolnay opened this issue May 18, 2019 · 6 comments
Open

Quantify benefit in the readme #2

dtolnay opened this issue May 18, 2019 · 6 comments

Comments

@dtolnay
Copy link

dtolnay commented May 18, 2019

What is the order of magnitude of the improvement that momo would enable? I think some indication of this would be necessary for readers to determine whether the cost/benefit tradeoff of pursuing momo makes sense.

It would be good to share some numbers from a project that heavily uses generics showing the compile time and binary size measured with and without momo.

@llogiq
Copy link
Owner

llogiq commented May 19, 2019

Do you happen to either have or know such a project?

@dtolnay
Copy link
Author

dtolnay commented May 19, 2019

No -- which is maybe what drives my skepticism. ;)

@dtolnay
Copy link
Author

dtolnay commented May 19, 2019

I tried generating some contrived code that I thought would be a best case scenario for momo -- many large function bodies that are instantiated across multiple generic parameters -- and was not able to find a case where introducing momo would make cargo clean && time cargo build faster. In most of what I tried it ended up compiling slower. I will be curious whether you come up with a different result.

@yvt
Copy link

yvt commented Oct 17, 2019

I tried disabling momo in my little personal project (with about 30kLOC and 7 instances of #[momo]) and got the following result:

momo in Cargo.toml #[momo] cargo build --release Executable Size
474.10s 839.4KB
Yes 501.30s 839.4KB
Yes Yes 488.40s 825.5KB

momo truly reduces the binary size (which is the primary objective for this project). It also cuts the compilation time down, but the compilation time of momo itself seems to be cancelling it out. I think the slow-down would be more pronounced if there are no other proc-macro crates, and less or virtually non-existent if used in even larger projects.

@llogiq
Copy link
Owner

llogiq commented Oct 17, 2019

I should take the time to convert Momo to Watt.

Artoria2e5 added a commit to Artoria2e5/momo that referenced this issue Aug 9, 2021
# This is the 1st commit message:

README: pointless change

# This is the commit message llogiq#2:

No-op (rustfmt)
@jgarvin
Copy link

jgarvin commented Jan 1, 2022

Wouldn't most of the time users have the build of momo cached? I think the time people would mostly care about is missing, where momo is already built but the crate using it is not.

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

No branches or pull requests

4 participants