public static void test_AABBTree_profile() { System.Console.WriteLine("Building test meshes"); DMesh3[] meshes = new DMesh3[NumTestCases]; for (int i = 0; i < NumTestCases; ++i) { meshes[i] = MakeSpatialTestMesh(i); } System.Console.WriteLine("done!"); int N = 10; // avoid garbage collection List <DMeshAABBTree3> trees = new List <DMeshAABBTree3>(); DMeshAABBTree3 tree = null; for (int i = 0; i < NumTestCases; ++i) { Stopwatch w = new Stopwatch(); for (int j = 0; j < N; ++j) { tree = new DMeshAABBTree3(meshes[i]); w.Start(); tree.Build(DMeshAABBTree3.BuildStrategy.TopDownMidpoint); //tree.Build(DMeshAABBTree3.BuildStrategy.TopDownMedian); //tree.Build(DMeshAABBTree3.BuildStrategy.BottomUpFromOneRings, DMeshAABBTree3.ClusterPolicy.FastVolumeMetric); w.Stop(); trees.Add(tree); } double avg_time = w.ElapsedTicks / (double)N; System.Console.WriteLine(string.Format("Case {0}: time {1} tris {2} vol {3} len {4}", i, avg_time, tree.Mesh.TriangleCount, tree.TotalVolume(), tree.TotalExtentSum())); } }