Skip to content

[Responsiveness] CommandLineArguments.Parse substrings every argument twice causing lots of unneeded allocations (1% - 5%) during solution load #53570

@davkean

Description

@davkean

Version Used:
17.0.0 Preview 1.0 [31313.406.main]

Steps to Reproduce:

CommandLineArguments.Parse is called a lot during solution open by both Roslyn and the project system.

Trace

image

This code double-parses every option twice just to find the ruleset option:

foreach (string arg in flattenedArgs)
{
string? name, value;
if (TryParseOption(arg, out name, out value) && (name == "ruleset"))

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions