The Wayback Machine - https://web.archive.org/web/20230303152232/https://github.com/dotnet/Silk.NET/issues/305
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

Trimming #305

Open
HurricanKai opened this issue Sep 3, 2020 · 10 comments
Open

Trimming #305

HurricanKai opened this issue Sep 3, 2020 · 10 comments

Comments

@HurricanKai
Copy link
Member

In addition to the work done in #303 we should consider trimming. Our assemblies are already very large, so trimming would be of great use.
See https://devblogs.microsoft.com/dotnet/customizing-trimming-in-net-core-5/

@HurricanKai HurricanKai added this to the 2.0 milestone Sep 3, 2020
@Perksey
Copy link
Member

Perksey commented Sep 3, 2020

Trimming is more suited for the end consumer (application) instead of libraries, as you don't want to prematurely trim away IL for it to blow up on the downstream consumer.

@Perksey Perksey closed this as completed Sep 3, 2020
@HurricanKai
Copy link
Member Author

In the article they mention that libraries can (and should if possible) annotate APIs.
This won't be needed anymore once reflection has been eliminated, but if that doesn't work out, annotating the api is a good idea.

@HurricanKai HurricanKai reopened this Sep 3, 2020
@HurricanKai HurricanKai self-assigned this Sep 3, 2020
@Perksey
Copy link
Member

Perksey commented Sep 3, 2020

I am not open to any trimming operations being done to Silk.NET itself. However, if we needed to annotate some APIs for the new (experimental) trimmer then this should be done no earlier than 3.0.

@HurricanKai
Copy link
Member Author

Could you explain why you don't want this to be (optionally) done in 2.0?

@Perksey
Copy link
Member

Perksey commented Sep 3, 2020

Primarily because as of 2.0 Silk.NET is still a .NET Standard library, and the new trimmer is .NET 5 only.

@HurricanKai
Copy link
Member Author

I see, so you're not happy to multi-target to net5 just for this?

@Perksey
Copy link
Member

Perksey commented Sep 3, 2020

Not for something like this, as it'll be large-scale and files will get messy with lots of preprocessor directives.

@HurricanKai HurricanKai modified the milestones: 2.0, 3.0 Sep 3, 2020
@Perksey Perksey added this to To do in 2.0 Development Sep 6, 2020
@Perksey Perksey removed this from To do in 2.0 Development Nov 12, 2020
@Perksey Perksey modified the milestone: 3.0 Jun 11, 2021
@Perksey Perksey added this to TODO (Preview 4) in 3.0 Tracker (OLD, PRE-REWRITE) Jun 11, 2021
@Perksey Perksey mentioned this issue Jul 5, 2021
@Perksey
Copy link
Member

Perksey commented Jul 5, 2021

Apparently auto trimming is cool, see this tweet from Tanner https://twitter.com/tannergooding/status/1412124486539702272?s=20

@HurricanKai HurricanKai removed their assignment Apr 8, 2022
@cyraid
Copy link

cyraid commented Mar 2, 2023

@Perksey Trimming is becoming more of a thing now, not sure your comments aged well. One of those decisions that were perhaps made hastily or without considering trimming to be more mainstream. It's definitely up to the libraries to provide hints, as AOT is more and more a thing. Silk.NET is quite bloaty and trimming would help a lot.

@Perksey
Copy link
Member

Perksey commented Mar 3, 2023

I still stand by all of my comments, it would be a maintenance nightmare for 2.X to annotate everything given the multitargeting. You missed the part where I said we’ll do this in 3.0 and the fact that the issue is still open, so we will do this eventually. But thank you for your opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants