Beispiel #1
0
        protected override void RunBenchmark(BenchmarkResult bRes)
        {
            bRes.BeginLabel("AoS Accumulation");

            Vector3 v;

            for (int i = 0; i < elementCount; i++)
            {
                v             = this.aos[i];
                this.accum.x += v.x;
                this.accum.y += v.y;
                this.accum.z += v.z;
            }

            bRes.EndLabel();
            bRes.BeginLabel("SoA Accumulation");

            for (int i = 0; i < elementCount; i++)
            {
                this.accumX += this.soa.x[i];
                this.accumY += this.soa.y[i];
                this.accumZ += this.soa.z[i];
            }

            bRes.EndLabel();
        }
Beispiel #2
0
        protected override void RunBenchmark(BenchmarkResult bRes)
        {
            bRes.BeginLabel("10k simple prototypes load");

            this.parser.Parse(this.xml, "TEST", new PrototypeParseParameters()
            {
                standardNamespace = "UnityTK.Editor.Benchmarking"
            });

            bRes.EndLabel();
        }
        protected override void RunBenchmark(BenchmarkResult bRes)
        {
            bRes.BeginLabel("10k simple prototypes load");

            this.parser.Parse(this.xml, "TEST");

            foreach (var error in this.parser.GetParsingErrors())
            {
                error.DoUnityDebugLog();
            }

            bRes.EndLabel();
        }
        protected override void RunBenchmark(BenchmarkResult bRes)
        {
            bRes.BeginLabel("10k adds");

            for (int i = 0; i < 10000; i++)
            {
                this.linkedList.Add(i);
            }

            bRes.EndLabel();

            bRes.BeginLabel("10k first removals");

            for (int i = 0; i < 10000; i++)
            {
                this.linkedList.RemoveElement(this.linkedList.first);
            }

            bRes.EndLabel();

            bRes.BeginLabel("10k adds");

            for (int i = 0; i < 10000; i++)
            {
                this.linkedList.Add(i);
            }

            bRes.EndLabel();

            bRes.BeginLabel("10k last removals");

            for (int i = 0; i < 10000; i++)
            {
                this.linkedList.RemoveElement(this.linkedList.last);
            }

            bRes.EndLabel();
        }
        protected override void RunBenchmark(BenchmarkResult bRes)
        {
            bRes.BeginLabel("Graph");

            // Benchmark node iteration
            bRes.BeginLabel("Node Iteration");

            float v = 0;

            foreach (var node in graph)
            {
                v += node;
            }

            bRes.EndLabel();

            // Benchmark node connection iteration
            bRes.BeginLabel("Node Connection Iteration");

            v = 0;
            for (int i = 0; i < NODECOUNT; i++)
            {
                var enumerator = graph.GetConnectedNodes(i);
                while (enumerator.MoveNext())
                {
                    v += enumerator.Current.data;
                }
            }

            bRes.EndLabel();

            bRes.EndLabel();

            bRes.BeginLabel("FastGraph");

            // Benchmark node iteration
            bRes.BeginLabel("Node Iteration");

            v = 0;
            foreach (var node in fastGraph)
            {
                v += node;
            }

            bRes.EndLabel();

            // Benchmark node connection iteration
            bRes.BeginLabel("Node Connection Iteration");

            v = 0;
            for (int i = 0; i < NODECOUNT; i++)
            {
                var enumerator = fastGraph.GetConnectedNodes(i);
                while (enumerator.MoveNext())
                {
                    v += enumerator.Current.data;
                }
            }

            bRes.EndLabel();

            bRes.EndLabel();
        }