You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rewrite analyzer using Roslyn Operations for speed and cross-language support #19648
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
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
@roji I see a difference in build times on my machine, although it's not nearly as pronounced as reported above. I have again captured and attached diagnostic build logs. It doesn't look to me that this is specific to the EF analyzers, but more related to how the build operates with/without analyzers turned on. However, I could be totally wrong!
Could you take a look at the logs and then follow up with your analyzer contacts?
changed the title [-]Adding Microsoft.EntityFrameworkCore.Analyzers (3.1.1) slows down build significantly[/-][+]Rewrite analyzer using Roslyn Operations for speed and cross-language support[/+]on Aug 8, 2020
As suggested by @mvasani and @sharwell, rewriting the analyzer using Operations brought the build time from around 10 seconds to 2, roughly the same as without the analyzer. Thanks!
Activity
ajcvickers commentedon Jan 21, 2020
Related to #18618 and possibly #19597
/cc @roji
ajcvickers commentedon Jan 29, 2020
@roji I see a difference in build times on my machine, although it's not nearly as pronounced as reported above. I have again captured and attached diagnostic build logs. It doesn't look to me that this is specific to the EF analyzers, but more related to how the build operates with/without analyzers turned on. However, I could be totally wrong!
Could you take a look at the logs and then follow up with your analyzer contacts?
with_analyzers.txt
without_analyzers.txt
ajcvickers commentedon Jan 29, 2020
Attaching binlogs here too.
binlogs.zip
roji commentedon Jan 29, 2020
@ajcvickers thanks for the work... I'll follow up on this.
roji commentedon Jan 31, 2020
Note: will continue investigation in #19597 assuming this is a dup until we see otherwise.
roji commentedon Feb 3, 2020
This is not a dup of #19597, and I repro a x10 degradation in build time (with --no-incremental --no-restore). I'll investigate further.
[-]Adding Microsoft.EntityFrameworkCore.Analyzers (3.1.1) slows down build significantly[/-][+]Rewrite analyzer using Roslyn Operations for speed and cross-language support[/+]roji commentedon Aug 8, 2020
As suggested by @mvasani and @sharwell, rewriting the analyzer using Operations brought the build time from around 10 seconds to 2, roughly the same as without the analyzer. Thanks!
Redo pubternalyzer with Roslyn Operations
1 remaining item
Redo pubternalyzer with Roslyn Operations
Redo pubternalyzer with Roslyn Operations (#21996)