コード例 #1
0
        //public DynamicMethod _normalClassDynamicMethod;
        //public NormalClass _normalClassDynamicMethodClass;
        //private MethodDelegate _normalClassDynamicMethodDelegated;

        public CallTests()
        {
            {
                var nc = new NormalClass(0);
                _normalClassRef.Add(nc);
                _normalClassLambda = () => nc.Method();
            }
            {
                var nc = new NormalClass(0);
                _normalClassRef.Add(nc);
                Expression <Func <int> > et = () => nc.Method();
                _normalClassExpressionTree = et.Compile();
            }
            {
                var nc = new NormalClass(0);
                _normalClassRef.Add(nc);
                _normalClassDelegate = nc.Method;
            }
            {
                var nc = new NormalClass(0);
                _normalClassRef.Add(nc);
                _normalClassDynamic = nc;
            }
            {
                var nc = new NormalClass(0);
                _normalClassRef.Add(nc);
                _normalClassReflectionClass      = nc;
                _normalClassReflectionMethodInfo = nc.GetType().GetMethod("Method");
            }

            //GenerateDynamicMethod();
        }
コード例 #2
0
 [Benchmark(Baseline = true, Description = "*Normal")] public void Call_NormalClass() => _normalClass.Method();