4 using System.Diagnostics;
6 namespace SiliconStudio.
Paradox.Shaders.Parser.Performance
10 private static Stopwatch
Global =
new Stopwatch();
13 private static Stopwatch
RegenKeys =
new Stopwatch();
32 case MixStage.AddDefaultCompositions:
33 AddDefaultCompositions.Start();
35 case MixStage.CreateReferencesStructures:
36 CreateReferencesStructures.Start();
38 case MixStage.RegenKeys:
41 case MixStage.BuildMixinInheritance:
42 BuildMixinInheritance.Start();
44 case MixStage.ComputeMixinOccurence:
45 ComputeMixinOccurence.Start();
47 case MixStage.BuildStageInheritance:
48 BuildStageInheritance.Start();
50 case MixStage.LinkVariables:
51 LinkVariables.Start();
53 case MixStage.ProcessExterns:
54 ProcessExterns.Start();
56 case MixStage.PatchAllMethodInferences:
57 PatchAllMethodInferences.Start();
59 case MixStage.MergeReferences:
60 MergeReferences.Start();
62 case MixStage.RenameAllVariables:
63 RenameAllVariables.Start();
65 case MixStage.RenameAllMethods:
66 RenameAllMethods.Start();
68 case MixStage.GenerateShader:
69 GenerateShader.Start();
81 case MixStage.AddDefaultCompositions:
82 AddDefaultCompositions.Stop();
84 case MixStage.CreateReferencesStructures:
85 CreateReferencesStructures.Stop();
87 case MixStage.RegenKeys:
90 case MixStage.BuildMixinInheritance:
91 BuildMixinInheritance.Stop();
93 case MixStage.ComputeMixinOccurence:
94 ComputeMixinOccurence.Stop();
96 case MixStage.BuildStageInheritance:
97 BuildStageInheritance.Stop();
99 case MixStage.LinkVariables:
100 LinkVariables.Stop();
102 case MixStage.ProcessExterns:
103 ProcessExterns.Stop();
105 case MixStage.PatchAllMethodInferences:
106 PatchAllMethodInferences.Stop();
108 case MixStage.MergeReferences:
109 MergeReferences.Stop();
111 case MixStage.RenameAllVariables:
112 RenameAllVariables.Stop();
114 case MixStage.RenameAllMethods:
115 RenameAllMethods.Stop();
117 case MixStage.GenerateShader:
118 GenerateShader.Stop();
126 AddDefaultCompositions.Reset();
127 CreateReferencesStructures.Reset();
129 BuildMixinInheritance.Reset();
130 ComputeMixinOccurence.Reset();
131 BuildStageInheritance.Reset();
132 LinkVariables.Reset();
133 ProcessExterns.Reset();
134 PatchAllMethodInferences.Reset();
135 MergeReferences.Reset();
136 RenameAllVariables.Reset();
137 RenameAllMethods.Reset();
138 GenerateShader.Reset();
144 Console.WriteLine(
@"---------------------------------MIX ANALYZER-----------------------------------");
145 Console.WriteLine(
@"Whole mix took {0} ms", Global.ElapsedMilliseconds);
146 Console.WriteLine(
@"AddDefaultCompositions took {0} ms", AddDefaultCompositions.ElapsedMilliseconds);
147 Console.WriteLine(
@"CreateReferencesStructures took {0} ms", CreateReferencesStructures.ElapsedMilliseconds);
148 Console.WriteLine(
@"RegenKeys took {0} ms", RegenKeys.ElapsedMilliseconds);
149 Console.WriteLine(
@"BuildMixinInheritance took {0} ms", BuildMixinInheritance.ElapsedMilliseconds);
150 Console.WriteLine(
@"ComputeMixinOccurence took {0} ms", ComputeMixinOccurence.ElapsedMilliseconds);
151 Console.WriteLine(
@"BuildStageInheritance took {0} ms", BuildStageInheritance.ElapsedMilliseconds);
152 Console.WriteLine(
@"LinkVariables took {0} ms", LinkVariables.ElapsedMilliseconds);
153 Console.WriteLine(
@"ProcessExterns took {0} ms", ProcessExterns.ElapsedMilliseconds);
154 Console.WriteLine(
@"PatchAllMethodInferences took {0} ms", PatchAllMethodInferences.ElapsedMilliseconds);
155 Console.WriteLine(
@"MergeReferences took {0} ms", MergeReferences.ElapsedMilliseconds);
156 Console.WriteLine(
@"RenameAllVariables took {0} ms", RenameAllVariables.ElapsedMilliseconds);
157 Console.WriteLine(
@"RenameAllMethods took {0} ms", RenameAllMethods.ElapsedMilliseconds);
158 Console.WriteLine(
@"GenerateShader took {0} ms", GenerateShader.ElapsedMilliseconds);
159 Console.WriteLine(
@"-------------------------------------------------------------------------------");