Skip to content

Simplify generated code check in AccessAnalyzer#6581

Merged
metalgearsloth merged 1 commit into
space-wizards:masterfrom
Tayrtahn:perf/access-analyzer-generated
Jun 27, 2026
Merged

Simplify generated code check in AccessAnalyzer#6581
metalgearsloth merged 1 commit into
space-wizards:masterfrom
Tayrtahn:perf/access-analyzer-generated

Conversation

@Tayrtahn

@Tayrtahn Tayrtahn commented May 19, 2026

Copy link
Copy Markdown
Contributor

AccessAnalyzer currently handles auto-generated code by examining the generated files normally and doing an attribute lookup on every access attempt within them to check for the RobustAutoGeneratedAttribute. This is slow and relies on all generated code remembering to apply the attribute.

Instead of doing all that, this PR changes the GeneratedCodeAnalysisFlags to None instead of Analyze | ReportDiagnostics.

On my machine, this reduced the execution time of AccessAnalyzer when packaging Content.Server from ~3.5 seconds (the slowest of our analyzers) to ~0.5 seconds.

@Tayrtahn Tayrtahn added T: Performance Type: Performance problem or optimization A: Roslyn Components Roslyn analyzers, source generators, code fixes labels May 19, 2026
@Tayrtahn Tayrtahn closed this Jun 23, 2026
@Tayrtahn Tayrtahn reopened this Jun 26, 2026
@metalgearsloth

Copy link
Copy Markdown
Contributor

I don't understand analyzers but works on my machine, good to see you re-open it.

@metalgearsloth metalgearsloth merged commit 9c45f8c into space-wizards:master Jun 27, 2026
14 checks passed
@Tayrtahn Tayrtahn deleted the perf/access-analyzer-generated branch June 27, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Roslyn Components Roslyn analyzers, source generators, code fixes T: Performance Type: Performance problem or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants