Flash0ver / F0.Minesweeper

Source of truth for a Blazor implementation of Minesweeper.
MIT License
6 stars 0 forks source link

Profile delay on first uncover #104

Open Flash0ver opened 2 years ago

Flash0ver commented 2 years ago

The duration between the first click and the actual uncover of the selected cell is noticeable. Especially on the Hard difficulty. Let's profile and find out where we could improve performance.

E.g. via (not sure which tool works with Blazor/WASM)

We may also need to check other tools.

dev-in-disguise commented 2 years ago

I've checked some things here already which I want to share so that I do not forget about them 🤕🤣

Apart from those initially in the issue mentioned ways I also looked up other things. But generally speaking there is no way to accurately profile a Blazor WASM application. There is an issue for that but it doesn't look like there's any progress. I found MiniProfiler which sounds promising but it does not have Blazor support. There is an issue where someone tries to add it but hit some blockers. And there even does not seem to be a version of the currently working blazor support published on nuget. So that's out of the window too.

Generally I have a question: do we want to just fix this current issue or do we want to continue profiling the performance of previous slow performers? If it's the former I'd just use either the browers profiling with jsinterop or the Visual Studio Profiler. If it's the latter I'll continue my research.

dev-in-disguise commented 2 years ago

And here is the blog post which shows us how we can track performance via JSInterop that we talked about in todays session

Flash0ver commented 2 years ago

We discussed: since the performance issue is in the Logic library, let's not add any JavaScript/Blazor/WASM profiling for now - but later on when we actually do have a performance issue in either the App or Components project. For this issue we find the class/method responsible within the Logic project, and add a [Benchmark] to see the before/after performance. See also issue dotnet/aspnetcore#64 / PR dotnet/aspnetcore#106 which adds BenchmarkDotNet.