From 8a1e0098505aeb1998f2a7f225f531d68aa6d227 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 19 Oct 2021 17:54:48 +0000 Subject: [PATCH] --- devdocs/tools.txt | 18 +++++++++++++++++- server/AyaNova/biz/TagBiz.cs | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/devdocs/tools.txt b/devdocs/tools.txt index c05894fe..5bb625e2 100644 --- a/devdocs/tools.txt +++ b/devdocs/tools.txt @@ -763,4 +763,20 @@ https://bennettadelson.wordpress.com/2013/04/11/using-perfview-to-diagnose-a-net HOW TO SEE WHO CALLED A METHOD DURING RUNTIME keywords: caller, call method stack trace stacktrace //System.Diagnostics.Debug.WriteLine((new System.Diagnostics.StackTrace()).GetFrame(1).GetMethod().Name); -//System.Diagnostics.Debug.WriteLine((new System.Diagnostics.StackTrace()).ToString().Substring(56,80)); \ No newline at end of file +//System.Diagnostics.Debug.WriteLine((new System.Diagnostics.StackTrace()).ToString().Substring(56,80)); + +Profiling / perf testing / performance testing +How to peformance test + +get process id for AyaNova +C:\temp\xfer\perf>dotnet-trace ps + 12048 AyaNova C:\temp\xfer\v8test\win-x64\ayanova\AyaNova.exe + +collect data with dotnet trace: +dotnet-trace collect --process-id 12048 --format Speedscope + +Use speedscope or built in to Chrome flame graph +https://www.hanselman.com/blog/dotnettrace-for-net-core-tracing-in-perfview-speedscope-chromium-event-trace-profiling-flame-graphs-and-more + +how to read a flame graph: +https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html \ No newline at end of file diff --git a/server/AyaNova/biz/TagBiz.cs b/server/AyaNova/biz/TagBiz.cs index 906366d4..6c5430d3 100644 --- a/server/AyaNova/biz/TagBiz.cs +++ b/server/AyaNova/biz/TagBiz.cs @@ -122,6 +122,7 @@ namespace AyaNova.Biz public static async Task ProcessUpdateTagsInRepositoryAsync(AyContext ct, List newTags, List originalTags = null) { + //todo: Recode this as a procedure like search indexing or at least a direct sql call //just in case no new tags are present which could mean a user removed all tags from a record so this //needs to proceed with the code below even if newTags is null as long as originalTags isn't also null if (newTags == null) newTags = new List();