Skip to content

ActionRegistrationSourceGenerator poor performance #115

@AlmightyLaxz

Description

@AlmightyLaxz

I have a .NET 10.0 Godot 4.5 project which is hit very hard by the ActionRegistrationSourceGenerator. It adds nearly 10 seconds to build times in my somewhat sizeable project.

I've done some tests with Stopwatch and found this part in ActionRegistrationSourceGenerator.cs seems to be the culprit:

var actions = new List<YarnAction>();
foreach (var tree in compilation.SyntaxTrees)
{
    actions.AddRange(Analyser.GetActions(compilation, tree, output).Where(a => a.DeclarationType == DeclarationType.Attribute));
}

As is, the performance impact of this generator is a bit of a deal breaker for using this addon personally.

Perhaps the ActionRegistrationSourceGenerator could be replaced with an incremental source generator without the file IO and Directory usage?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions