public PerformanceCriticalCodeAnalysisProcess([NotNull] IDaemonProcess process, [NotNull] ICSharpFile file, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                                      [NotNull] SolutionAnalysisService swa, CallGraphActivityTracker tracker, [NotNull] PerformanceCriticalCodeCallGraphAnalyzer performanceAnalyzer,
                                                      [NotNull] ExpensiveCodeCallGraphAnalyzer expensiveCodeCallGraphAnalyzer)
            : base(process, file)
        {
            myCallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
            mySwa     = swa;
            myTracker = tracker;
            myPerformanceAnalyzerId = performanceAnalyzer.Id;
            myExpensiveAnalyzerId   = expensiveCodeCallGraphAnalyzer.Id;

            myLineMarkerEnabled = DaemonProcess.ContextBoundSettingsStore.GetValue((UnitySettings key) =>
                                                                                   key.PerformanceHighlightingMode) == PerformanceHighlightingMode.Always;
        }
        private bool IsMarked(IGlobalUsageChecker usageChecker, CallGraphAnalyzerId analyzerId, IDeclaredElement element)
        {
            if (element == null)
            {
                return(false);
            }
            var id = mySwa.GetElementId(element, true);

            if (!id.HasValue)
            {
                return(false);
            }

            return(myTracker.RegisterCallGraphQueryTime(() =>
                                                        myCallGraphSwaExtensionProvider.IsMarkedByCallGraphAnalyzer(analyzerId, id.Value, true)));
        }