Skip to content

"dotnet run --no-restore --no-build --no-launch-profile" significantly slower than "dotnet exec <path-to-dll>" #51460

Description

@lafritay

Describe the bug

After building a fairly large dll, this command (run from the project directory):

dotnet run --no-restore --no-build --no-launch-profile

takes 8 seconds longer than running this command:

dotnet exec

I understand that dotnet run may add some overhead but 8 seconds seems like way too much. This does not happen with a fresh project so it seems that something specific to my project or environment is causing the issue. I've added logging to ensure that the program has the same PWD and the same number of managed assemblies are loaded. I've taken hostlog traces and can confirm that the overhead is coming before my app is invoked.

Further technical details

See the attached hostlog traces and timestamps within. "run.hostlog.txt" is the one from "dotnet run" that has the additional overhead.

run.hostlog.txt
exec.hostlog.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CLIArea-PerformanceRelated to CLI/Build performanceArea-RunIssues relating to `dotnet run`untriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions