Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Nov 10, 2024

Closes #3988

@roji roji requested a review from a team November 10, 2024 19:08
[.NET NativeAOT](/dotnet/core/deploying/native-aot) allows publishing self-contained .NET applications that have been compiled ahead-of-time (AOT). Doing so offers the following advantages:

* Significantly faster application startup time
* Small, self-contained binaries that have smaller memory footprints and are easier to deploy
Copy link
Contributor

Choose a reason for hiding this comment

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

"Small" here is a relative term. Compared to FDD, it is orders of magnitude bigger.

Copy link
Member Author

Choose a reason for hiding this comment

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

What's FDD? :) Are you proposing to change "small" to "smaller"?

Copy link
Contributor

Choose a reason for hiding this comment

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

FDD = Framework Dependent Deployment.

I would, personally and generally, avoid talking about binary size here. :)

Copy link
Member Author

@roji roji Nov 11, 2024

Choose a reason for hiding this comment

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

Comparing to FDD is a bit disingenuous, since you have to have the full .NET runtime installed, no? A hello world NativeAOT app is a few MBs, whereas the same thing with FDD is far bigger, if you count the runtime... Note that this mentions "small, self-contained", so if anything the comparison should be to SCD, where NativeAOT really is clearly much much smaller...

In any case, regardless of EF, smaller binary size is one of the main points of NativeAOT overall - it's certainly mentioned all around...

@roji roji requested a review from cincuranet November 11, 2024 19:25
```console
dotnet ef dbcontext optimize --precompile-queries --nativeaot
```

Copy link
Member

@AndriySvyryd AndriySvyryd Nov 11, 2024

Choose a reason for hiding this comment

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

I'll add a link here to the MSBuild integration documentation in my PR

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. I've amended the docs to show adding the Tasks package rather than running dotnet ef dbcontext optimize - in any case a link to the dedicated docs makes sense.

@roji roji merged commit c574492 into dotnet:main Nov 12, 2024
3 checks passed
@roji roji deleted the NativeAOT branch November 12, 2024 09:57
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.

Document guidelines for using EF Core with trimming or NativeAOT

4 participants