Пример #1
0
        public static void DistanceSquaredJitOptimizeCanaryBenchmark()
        {
            const float expectedResult = 268435456.0f;

            foreach (var iteration in Benchmark.Iterations)
            {
                float actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = DistanceSquaredJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #2
0
        public static void AddOperatorBenchmark()
        {
            var expectedResult = VectorTests.Vector3Value;

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector3 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = AddOperatorTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #3
0
        public static void DotJitOptimizeCanaryBenchmark()
        {
            const float expectedResult = -67108864.0f;

            foreach (var iteration in Benchmark.Iterations)
            {
                float result;

                using (iteration.StartMeasurement())
                {
                    result = DotJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, result);
            }
        }
Пример #4
0
        public static void SubtractFunctionBenchmark()
        {
            var expectedResult = VectorTests.Vector4Value;

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector4 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = SubtractFunctionTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #5
0
        public static void MultiplyFunctionBenchmark()
        {
            var expectedResult = Vector2.Zero;

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector2 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = MultiplyFunctionTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #6
0
        public static void DotBenchmark()
        {
            const float expectedResult = -3.0f;

            foreach (var iteration in Benchmark.Iterations)
            {
                float actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = DotTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #7
0
        public static void NormalizeBenchmark()
        {
            var expectedResult = new Vector2(-0.707106829f, 0.707106829f);

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector2 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = NormalizeTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #8
0
        public static void NormalizeJitOptimizeCanaryBenchmark()
        {
            var expectedResult = new Vector2(-16777216.0f, 16777216.0f);

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector2 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = NormalizeJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #9
0
        public static void LengthBenchmark()
        {
            const float expectedResult = 1.73205078f;

            foreach (var iteration in Benchmark.Iterations)
            {
                float actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = LengthTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #10
0
        public static void LengthJitOptimizeCanaryBenchmark()
        {
            const float expectedResult = 33554432.0f;

            foreach (var iteration in Benchmark.Iterations)
            {
                float actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = LengthJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #11
0
        public static void SquareRootJitOptimizeCanaryBenchmark()
        {
            var expectedResult = new Vector3(float.NaN, 2.81474977e+14f, float.NaN);

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector3 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = SquareRootJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #12
0
        public static void SquareRootBenchmark()
        {
            var expectedResult = new Vector3(float.NaN, 1.0f, float.NaN);

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector3 actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = SquareRootTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #13
0
        public static void GetHashCodeJitOptimizeCanaryBenchmark()
        {
            const int expectedResult = 504524288;

            foreach (var iteration in Benchmark.Iterations)
            {
                int actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = GetHashCodeJitOptimizeCanaryTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #14
0
        public static void GetHashCodeBenchmark()
        {
            const int expectedResult = 536896558;

            foreach (var iteration in Benchmark.Iterations)
            {
                int actualResult;

                using (iteration.StartMeasurement())
                {
                    actualResult = GetHashCodeTest();
                }

                VectorTests.AssertEqual(expectedResult, actualResult);
            }
        }
Пример #15
0
        public static void CrossBenchmark()
        {
            var expectedResult = Vector3.Zero;

            foreach (var iteration in Benchmark.Iterations)
            {
                Vector3 result;

                using (iteration.StartMeasurement())
                {
                    result = CrossTest();
                }

                VectorTests.AssertEqual(expectedResult, result);
            }
        }