Skip to content

Rewrite analyzer using Roslyn Operations for speed and cross-language support #19648

@toshke994

Description

@toshke994

I am upgrading our project from .netcore 2.1 to 3.1.1. (and EF core with it). One of the projects that doesn't use EF at all references another project that does reference it, and as a result building the first project takes around 30 minutes.

I have isolated the problem in the sample app.
Build time while referencing Microsoft.EntityFrameworkCore.Analyzers (3.1.1) ~10000ms
Build time without referencing Microsoft.EntityFrameworkCore.Analyzers (3.1.1) ~200ms

Steps to reproduce

BuildSpeedTest.zip

Build a provided solution while referencing Microsoft.EntityFrameworkCore.Analyzers (3.1.1) and it should take ~10000ms (±1s)
Build without referencing Microsoft.EntityFrameworkCore.Analyzers (3.1.1), or disable running analyzers during the build and it should take ~200ms

Reducing the size of StaticArray will reduce the build time and vice versa.

Further technical details

EF Core version: 3.1.1
Target framework: .NET Core 3.1
Operating system: Windows 10 Pro (Version 1909)
IDE: Visual Studio 2019 16.4.3

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions