Ejemplo n.º 1
0
    public static void main(string[] args)
    {
        int nbTests             = (args != null && args.Length >= 1) ? int.Parse(args[0]) : NB_TESTS;
        int nbOfExclusionMinMax = (args != null && args.Length >= 2) ? int.Parse(args[1]) : NB_OF_EXCLUSION_MIN_MAX;

        List <long> executionTimes = new List <long>(nbTests);


        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testGetterClassWith1int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Getter of ClassWith1int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterClassWith1int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter of ClassWith1int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterGetterClassWith1int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter Getter of ClassWith1int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testGetterClassWith10int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Getter of ClassWith10int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterClassWith10int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter of ClassWith10int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterGetterClassWith10int());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter Getter of ClassWith10int() test=" + NB_SETTER_GETTER_INT_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testGetterClassWith1String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Getter of ClassWith1String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterClassWith1String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter of ClassWith1String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterGetterClassWith1String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter Getter of ClassWith1String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();


        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testGetterClassWith10String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Getter of ClassWith10String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterClassWith10String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter of ClassWith10String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();

        for (int i = nbTests; i != 0; i--)
        {
            executionTimes.Add(GetterSetterTest.testSetterGetterClassWith10String());
        }
        executionTimes.Sort();
        Console.WriteLine("[GetterSetterTest], Setter Getter of ClassWith10String() test=" + NB_SETTER_GETTER_STRING_TESTS + ",, average time,"
                          + averageTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax) + ", min time," + executionTimes[0] + ", max time," + executionTimes[executionTimes.Count - 1]
                          + ", relative deviation time," + relativeDeviationTimeWithoutMinMax(executionTimes, nbOfExclusionMinMax));
        executionTimes.Clear();
    }
Ejemplo n.º 2
0
    public static void Main(string[] args)
    {
        StreamWriter sw = null;

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("getter-setter-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        GetterSetterTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("getter-setter-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        GetterSetterTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("invoke-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        InvokeTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("invoke-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        InvokeTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("creation-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        CreationTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("creation-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        CreationTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("collection-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        CollectionTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("collection-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        CollectionTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("arithmetic-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        ArithmeticTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("arithmetic-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        ArithmeticTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("threading-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        ThreadingTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("threading-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        ThreadingTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("timing-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        TimingTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("timing-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        TimingTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("autoboxing-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        AutoboxingTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("autoboxing-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        AutoboxingTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("file-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        FileTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("file-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        FileTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("exception-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        ExceptionTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("exception-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        ExceptionTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("recursive-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        RecursiveTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("recursive-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        RecursiveTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("stringconcat-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        StringConcatTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("stringconcat-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        StringConcatTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("nestedloops-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        NestedLoopsTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("nestedloops-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        NestedLoopsTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("heap-sort-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        HeapSortTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("heap-sort-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        HeapSortTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("matrix-multiply-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        MatrixMultiplyTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("matrix-multiply-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        MatrixMultiplyTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("reflection-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        ReflectionTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("reflection-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        ReflectionTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("enum-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        EnumTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("enum-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        EnumTest.main(ARGS);
        sw.Close();


        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("trigo-benchmark-csharp-firstinvoke.csv", FileMode.Create));
        Console.SetOut(sw);
        TrigoTest.main(ARGS);
        sw.Close();

        LaunchGcAndSleep();
        sw = new StreamWriter(new FileStream("trigo-benchmark-csharp.csv", FileMode.Create));
        Console.SetOut(sw);
        TrigoTest.main(ARGS);
        sw.Close();


        //TODO NetworkInvoke.main(ARGS);
    }