Esempio n. 1
0
        public static void BenchmarksGroup5()
        {
            var testObjects = new SampleClass[_testSize];

            for (int i = 0; i < _testSize; ++i)
            {
                testObjects[i] = new SampleClass();
            }
            // ReSharper disable CoVariantArrayConversion
            RunBenchmark("RawDuckProxyTypeCreation", () => RawDuckProxyTypeCreation(testObjects));
            // ReSharper restore CoVariantArrayConversion
        }
Esempio n. 2
0
        public static void BenchmarksGroup4()
        {
            var testObjects = new SampleClass[_testSize];

            for (int i = 0; i < _testSize; ++i)
            {
                testObjects[i] = new SampleClass();
            }
            // ReSharper disable CoVariantArrayConversion
            RunBenchmark("LowLevelCachedDuckProxyTypeCreation", () => LowLevelCachedDuckProxyTypeCreation(testObjects));
            var badDucks = CreateDucks <IDontGetAnswer>(testObjects);

            RunBenchmark("DuckMissingMethodExceptionCall", () => DuckMissingMethodExceptionCall(badDucks));
            RunBenchmark("DynamicMissingMethodExceptionCall", () => DynamicMissingMethodExceptionCall(badDucks));
            // ReSharper restore CoVariantArrayConversion
        }