Example #1
0
        private void GetItemAsDynamicTest(IOrmExecuter executer)
        {
            if (executer is IOrmWithCacheExecuter ormWithCacheExecuter)
            {
                ormWithCacheExecuter.ClearCache();
            }

            double firstItemExecTime = 0;
            double executionTime     = 0;
            bool   onlyFirst         = true;

            foreach (var id in _idList)
            {
                Stopwatch stopwatch = Stopwatch.StartNew();
                var       result    = executer.GetItemAsDynamic(id);
                stopwatch.Stop();

                if (result is null)
                {
                    return;
                }

                executionTime += GetNanoSeconds(stopwatch);
                if (onlyFirst)
                {
                    firstItemExecTime = executionTime;
                    onlyFirst         = false;
                }
            }
            ResultsForDynamicItem.Add(CreateResult(executer, executionTime, nameof(GetItemAsDynamicTest), firstItemExecTime));
        }
Example #2
0
        private void WarmUp(IOrmExecuter executer)
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            executer.GetItemAsObject(1);
            executer.GetItemAsDynamic(1);
            stopwatch.Stop();

            ResultsWarmUp.Add(CreateResult(executer, GetNanoSeconds(stopwatch), "WarmUp"));
        }