/// <summary> /// To measure things accurately we spawn a new process for every serializer and then create for 4 different types a serializer where some data is serialized /// </summary> private void FirstCall() { if (StartupSerializersToTest.Count == StartupSerializerCount) // we always create 4 serializer with different types for startup tests { var tester = new Test_O_N_Behavior(StartupSerializersToTest); tester.TestSerialize(new int[] { 1 }, nRuns: 1); } else { for (int i = 0; i < StartupSerializersToTest.Count; i += StartupSerializerCount) { var serializer = StartupSerializersToTest[i]; // Spawn new process for each serializer to measure each serializer overhead in isolation var startArgs = new ProcessStartInfo(Assembly.GetEntryAssembly().Location.Replace(".dll", ".exe"), String.Join(" ", Environment.GetCommandLineArgs().Skip(1)) + $" -serializer #{GetSimpleTypeName(serializer.GetType())}") { UseShellExecute = false, RedirectStandardOutput = true, }; Process proc = Process.Start(startArgs); // trim newline of newly started process string output = proc.StandardOutput.ReadToEnd().Trim(Environment.NewLine.ToCharArray()); if (i > 0) // trim header since we need it only once { output = output.Substring(output.IndexOf('\n') + 1); } Console.WriteLine(output); proc.WaitForExit(); } } }
private void Deserialize() { var tester = new Test_O_N_Behavior(TestSerializers); tester.TestDeserialize(NObjectsToDeSerialize, nRuns: Runs); }
private void Combined() { var tester = new Test_O_N_Behavior(TestSerializers); tester.TestCombined(NObjectsToDeSerialize, nRuns: Runs); }
/// <summary> /// Test for each serializer 5 different types the first call effect /// </summary> private void FirstCall() { var tester = new Test_O_N_Behavior(StartupSerializersToTest); tester.TestSerialize(maxNObjects: 1, nRuns: 1); }
private void Combined() { var tester = new Test_O_N_Behavior(TestSerializers); tester.TestCombined(maxNObjects: MaxObjectCount, nRuns: Runs); }
/// <summary> /// Test for each serializer 5 different types the first call effect /// </summary> private void FirstCall() { var tester = new Test_O_N_Behavior(StartupSerializersToTest); tester.TestSerialize(new int[] { 1 }, nRuns: 1); }
private void Combined() { var tester = new Test_O_N_Behavior(SerializersToTest); tester.TestCombined(nRuns: Runs); }
private void Serialize() { var tester = new Test_O_N_Behavior(SerializersToTest); tester.TestSerialize(nRuns: Runs); }