Class NativeAotToolchainBuilder
Inheritance
NativeAotToolchainBuilder
Assembly: BenchmarkDotNet.dll
public class NativeAotToolchainBuilder : CustomDotNetCliToolchainBuilder
Methods
Declaration
public static NativeAotToolchainBuilder Create()
Returns
This controls the generation of complete type metadata.
This option is enabled by default.
This is a compilation mode that prevents a situation where some members of a type are visible to reflection at runtime, but others aren't, because they weren't compiled.
Declaration
public NativeAotToolchainBuilder IlcGenerateCompleteTypeMetadata(bool value)
Parameters
Type |
Name |
Description |
Boolean |
value |
|
Returns
This controls generation of stack trace metadata that provides textual names in stack traces.
This option is enabled by default.
This is for example the text string one gets by calling Exception.ToString() on a caught exception.
With this option disabled, stack traces will still be generated, but will be based on reflection metadata alone (they might be less complete).
Declaration
public NativeAotToolchainBuilder IlcGenerateStackTraceData(bool value)
Parameters
Type |
Name |
Description |
Boolean |
value |
|
Returns
By default, the compiler targets the minimum instruction set supported by the target OS and architecture.
This option allows targeting newer instruction sets for better performance.
The native binary will require the instruction sets to be supported by the hardware in order to run.
For example, avx2,bmi2,fma,pclmul,popcnt,aes
will produce binary that takes advantage of instruction sets
that are typically present on current Intel and AMD processors.
Declaration
public NativeAotToolchainBuilder IlcInstructionSet(string value)
Parameters
Type |
Name |
Description |
String |
value |
Specify empty string ("", not null) to use the defaults.
|
Returns
Options related to code generation.
Declaration
public NativeAotToolchainBuilder IlcOptimizationPreference(string value = "Speed")
Parameters
Type |
Name |
Description |
String |
value |
"Speed" to favor code execution speed (default), "Size" to favor smaller code size
|
Returns
The directory to restore packages to (optional).
Declaration
public NativeAotToolchainBuilder PackagesRestorePath(string packagesRestorePath)
Parameters
Type |
Name |
Description |
String |
packagesRestorePath |
|
Returns
This controls the compiler behavior where all code in the application assemblies is considered dynamically reachable.
This option is disabled by default.
Enabling this option (true) has a significant effect on the size of the resulting executable because it prevents removal of unused code that would otherwise happen.
Declaration
public NativeAotToolchainBuilder RootAllApplicationAssemblies(bool value)
Parameters
Type |
Name |
Description |
Boolean |
value |
|
Returns
Declaration
public override IToolchain ToToolchain()
Returns
Overrides
Declaration
public NativeAotToolchainBuilder UseLocalBuild(DirectoryInfo ilcPackages)
Parameters
Type |
Name |
Description |
DirectoryInfo |
ilcPackages |
the path to shipping packages, example: "C:\runtime\artifacts\packages\Release\Shipping"
|
Returns
Declaration
public NativeAotToolchainBuilder UseNuGet(string microsoftDotNetILCompilerVersion = "7.0.0-*", string nuGetFeedUrl = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json")
Parameters
Type |
Name |
Description |
String |
microsoftDotNetILCompilerVersion |
the version of Microsoft.DotNet.ILCompiler which should be used. The default is: "7.0.0-*"
|
String |
nuGetFeedUrl |
url to NuGet feed, The default is: "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json"
|
Returns