From 30bc449c5fcd9c701de8f3c930a62eaed5d7df09 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sat, 2 Aug 2025 18:03:20 +1000 Subject: [PATCH] log sln parse time --- .../SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs | 6 +++++- src/SharpIDE.Photino/Layout/MainLayout.razor | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs b/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs index 2154a3c..2cfaa08 100644 --- a/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs +++ b/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs @@ -1,4 +1,5 @@ -using Ardalis.GuardClauses; +using System.Diagnostics; +using Ardalis.GuardClauses; using Microsoft.VisualStudio.SolutionPersistence.Model; using Microsoft.VisualStudio.SolutionPersistence.Serializer; @@ -8,6 +9,7 @@ public static class VsPersistenceMapper { public static async Task GetSolutionModel(string solutionFilePath, CancellationToken cancellationToken = default) { + var timer = Stopwatch.StartNew(); // This intermediate model is pretty much useless, but I have left it around as we grab the project nodes with it, which we might use later. var intermediateModel = await GetIntermediateModel(solutionFilePath, cancellationToken); @@ -24,6 +26,8 @@ public static class VsPersistenceMapper Projects = s.Projects.Select(GetSharpIdeProjectModel).ToList() }).ToList(), }; + timer.Stop(); + Console.WriteLine($"Solution model fully created in {timer.ElapsedMilliseconds} ms"); return solutionModel; } diff --git a/src/SharpIDE.Photino/Layout/MainLayout.razor b/src/SharpIDE.Photino/Layout/MainLayout.razor index f872f20..b3f3e48 100644 --- a/src/SharpIDE.Photino/Layout/MainLayout.razor +++ b/src/SharpIDE.Photino/Layout/MainLayout.razor @@ -74,7 +74,6 @@ var solutionFilePath = (string)result.Data!; _solutionFilePath = solutionFilePath; - //await BuildService.BuildSolutionAsync(_solutionFilePath); var solutionModel = await VsPersistenceMapper.GetSolutionModel(_solutionFilePath); _solutionModel = solutionModel; if (AppState.IdeSettings.AutoOpenTerminalOnLaunch)