Skip to content

Recommend -Zshare-generics=false with opt-level=z#81

Open
Noratrieb wants to merge 1 commit into
johnthagen:mainfrom
Noratrieb:patch-1
Open

Recommend -Zshare-generics=false with opt-level=z#81
Noratrieb wants to merge 1 commit into
johnthagen:mainfrom
Noratrieb:patch-1

Conversation

@Noratrieb

@Noratrieb Noratrieb commented Jun 7, 2025

Copy link
Copy Markdown

opt-level=z or opt-level=s implicitly enables -Zshare-generics=true, which sometimes has a positive and sometimes has a negative impact.

See rust-lang/rust#142164

Comment thread README.md
#[global_allocator]
static A: System = System;
``` No newline at end of file
```

@Noratrieb Noratrieb Jun 7, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Looks like there was no trailing newline and my editor added it automatically, which seems fine to me

@Noratrieb
Noratrieb marked this pull request as draft June 7, 2025 14:19
@Noratrieb

This comment was marked as resolved.

opt-level=z|s implicitly enables -Zshare-generics=true, which sometimes has a positive and sometimes has a negative impact.

Update README.md
@Noratrieb
Noratrieb marked this pull request as ready for review June 7, 2025 14:58
@Noratrieb

Copy link
Copy Markdown
Author

Although with fat LTO enabled this shouldn't make that much of a difference in practice. But I haven't tested that.

@Shatur Shatur left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Helped me to reduce the size even with fat lto.

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.

2 participants