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

Default Uri constructors brings a lot of dependencies #50359

Open
marek-safar opened this issue Mar 29, 2021 · 9 comments
Open

Default Uri constructors brings a lot of dependencies #50359

marek-safar opened this issue Mar 29, 2021 · 9 comments
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions size-reduction Issues impacting final app size primary for size sensitive workloads
Milestone

Comments

@marek-safar
Copy link
Contributor

Using a simple program like

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(new Uri ("www.microsoft.com"));
    }
}

shows that the default Uri constructor brings a lot for size-optimized setup. The size increase for adding Uri constructor is about 80 KB which seems to be a lot for a simple "default" constructor call.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 29, 2021
@marek-safar marek-safar added the size-reduction Issues impacting final app size primary for size sensitive workloads label Mar 29, 2021
@ghost
Copy link

ghost commented Mar 29, 2021

Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar, @tannergooding, @CoffeeFlux
See info in area-owners.md if you want to be subscribed.

Issue Details

Using a simple program like

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(new Uri ("www.microsoft.com"));
    }
}

shows that the default Uri constructor brings a lot for size-optimized setup. The size increase for adding Uri constructor is about 80 KB which seems to be a lot for a simple "default" constructor call.

Author: marek-safar
Assignees: -
Labels:

size-reduction, untriaged

Milestone: -

@ghost
Copy link

ghost commented Mar 29, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Using a simple program like

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(new Uri ("www.microsoft.com"));
    }
}

shows that the default Uri constructor brings a lot for size-optimized setup. The size increase for adding Uri constructor is about 80 KB which seems to be a lot for a simple "default" constructor call.

Author: marek-safar
Assignees: -
Labels:

area-System.Net, size-reduction, untriaged

Milestone: -

@CoffeeFlux
Copy link
Contributor

cc: @eerhardt

@scalablecory
Copy link
Contributor

It's not clear that this is a problem -- do we have a graph of which dependencies it brings in that we think would be reasonable to remove (i.e. not typically used alongside Uri)? Or, is this a work item for someone to investigate?

@CoffeeFlux
Copy link
Contributor

CoffeeFlux commented Apr 8, 2021

The latter - we're trying to identify promising candidates for further reduction, and 80K is a lot to bring in for just that constructor.

Ideally someone more familiar with the area would take a look at the dependency graph, and I would assume there is a somewhat linker-unfriendly design that we might want to re-evaluate for size-optimized scenarios. See #44534 for a similar example

@geoffkizer
Copy link
Contributor

Can you provide the dependency graph?

@CoffeeFlux
Copy link
Contributor

I normally use ILSpy to look at this, though I think there's a linker tool for it as well? cc: @marek-safar

See #44534 (comment) on how to generate the assemblies

@karelz karelz removed the untriaged New issue has not been triaged by the area owner label Apr 13, 2021
@karelz karelz added this to the Future milestone Apr 13, 2021
@karelz karelz added the enhancement Product code improvement that does NOT require public API changes/additions label Apr 13, 2021
@karelz
Copy link
Member

karelz commented Apr 13, 2021

Triage: Per discussion with @marek-safar does not seem critical for 6.0, moving to Future from Networking point of view.
We will be happy to help / provide advice if there is clear data available that is easy to digest. Let us know if that does not meet the expectations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions size-reduction Issues impacting final app size primary for size sensitive workloads
Projects
None yet
Development

No branches or pull requests

5 participants