diff options
author | therzok <marius.ungureanu@xamarin.com> | 2019-06-18 03:22:42 +0300 |
---|---|---|
committer | therzok <marius.ungureanu@xamarin.com> | 2019-06-20 05:09:11 +0300 |
commit | 47742270cbf8bc51864658484a7fdc378f6f53a9 (patch) | |
tree | 49a6a2703d741d610b414598dca496e1a4767566 /main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild | |
parent | a711ab2bb6e778873bea579fd3b27e2cdd666611 (diff) |
Initial work towards optimizing FileService handlers
Fixes VSTS #853896 - [Feedback] Visual Studio freezes when i run mono
Fixes VSTS #902435 - Investigate performance issue with FileSystemWatcher
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs | 5 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs index 0cc36a1f0e..49f790ef94 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs @@ -1435,7 +1435,10 @@ namespace MonoDevelop.Projects.MSBuild { var pi = (ProjectInfo)projectInstance; string filePath = MSBuildProjectService.FromMSBuildPath (pi.Project.BaseDirectory, include); - foreach (var g in pi.GlobIncludes.Where (g => g.Condition)) { + foreach (var g in pi.GlobIncludes) { + if (!g.Condition) + continue; + if (g.ExcludeRegex != null) { if (g.ExcludeRegex.IsMatch (include)) continue; diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs index d2874912c7..703bbcf97d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs @@ -843,7 +843,7 @@ namespace MonoDevelop.Projects.MSBuild { int i = str.IndexOfAny (specialCharacters); if (i != -1) { - var sb = new System.Text.StringBuilder (); + var sb = StringBuilderCache.Allocate (); int start = 0; while (i != -1) { sb.Append (str, start, i - start); @@ -855,7 +855,7 @@ namespace MonoDevelop.Projects.MSBuild } if (start < str.Length) sb.Append (str, start, str.Length - start); - return sb.ToString (); + return StringBuilderCache.ReturnAndFree (sb); } return str; } |