Beispiel #1
0
    /**
     * testInvokeOfAnInstanceMethodWithoutInterface.
     *
     * @return
     */
    public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface()
    {
        int        count  = 0;
        InvokeImpl invoke = new InvokeImpl();
        DateTime   start  = DateTime.Now;

        for (int i = NB_INVOKE_SETTER_TESTS; i != 0; i--)
        {
            // Write to force jre not to optimize the code
            if (i % 2 == 0)
            {
                count = count + invoke.echoWithSetVariable("1").Length;
            }
            else
            {
                count = count + invoke.echoWithSetVariable("0").Length;
            }
        }
        DateTime end           = DateTime.Now;
        TimeSpan executionTime = end - start;

        Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INVOKE_TESTS + " invoke.echoWithSetVariable(\"1\").Length, count=" + count + ", snapshot time,"
                          + executionTime.TotalMilliseconds);
        return((long)executionTime.TotalMilliseconds);
    }
Beispiel #2
0
    /**
     * testInvokeOfAStaticMethod.
     *
     * @return
     */
    public static long testInvokeOfAStaticMethodInt()
    {
        int      count = 0;
        DateTime start = DateTime.Now;

        for (int i = NB_INVOKE_TESTS; i != 0; i--)
        {
            count = count + InvokeImpl.echoStatic(i);
        }
        DateTime end           = DateTime.Now;
        TimeSpan executionTime = end - start;

        Console.WriteLine("[InvokeTest], Invoke Of A Static Method int " + NB_INVOKE_TESTS + " InvokeImpl.echoStatic(\"\").Length, count=" + count + ", snapshot time,"
                          + executionTime.TotalMilliseconds);
        return((long)executionTime.TotalMilliseconds);
    }
Beispiel #3
0
    /**
     * testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface.
     *
     * @return
     */
    public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface()
    {
        int        count  = 0;
        InvokeImpl invoke = new InvokeImpl();
        DateTime   start  = DateTime.Now;

        for (int i = NB_INSTANCE_REFLECTION_TESTS; i != 0; i--)
        {
            count = count + invoke.echoWithSetVariable("1").Length;
        }
        DateTime end           = DateTime.Now;
        TimeSpan executionTime = end - start;

        Console.WriteLine("[ReflectionTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INSTANCE_REFLECTION_TESTS + " invoke.echoWithSetVariable(\"1\").length()  , count=" + count + ", snapshot time,"
                          + executionTime.TotalMilliseconds);
        return((long)executionTime.TotalMilliseconds);
    }
Beispiel #4
0
    /**
     * testInvokeOfAInstanceMethodWithInterface.
     *
     * @return
     */
    public static long testInvokeOfAnInstanceMethodWithGetInstanceVariableWithInterface()
    {
        int      count  = 0;
        Invoke   invoke = new InvokeImpl();
        DateTime start  = DateTime.Now;

        for (int i = NB_INVOKE_GETTER_TESTS; i != 0; i--)
        {
            // Write to force cpp not to optimize the code, never executed
            if (i % 2 == 2)
            {
                invoke.setEchoGet("1");
            }
            count = count + invoke.echoWithGetVariable().Length;
        }
        DateTime end           = DateTime.Now;
        TimeSpan executionTime = end - start;

        Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Get Instance Variable With Interface " + NB_INVOKE_TESTS + " invoke.echoWithGetVariable().Length, count=" + count + ", snapshot time,"
                          + executionTime.TotalMilliseconds);
        return((long)executionTime.TotalMilliseconds);
    }
Beispiel #5
0
    /**
     * testInvokeOfAStaticMethod.
     *
     * @return
     */
    public static long testInvokeOfAStaticMethodString()
    {
        int      count = 0;
        DateTime start = DateTime.Now;

        for (int i = NB_INVOKE_TESTS; i != 0; i--)
        {
            // Write to force jre not to optimize the code
            if (i % 2 == 0)
            {
                count = count + InvokeImpl.echoStatic("1").Length;
            }
            else
            {
                count = count + InvokeImpl.echoStatic("0").Length;
            }
        }
        DateTime end           = DateTime.Now;
        TimeSpan executionTime = end - start;

        Console.WriteLine("[InvokeTest], Invoke Of A Static Method String " + NB_INVOKE_TESTS + " InvokeImpl.echoStatic(i), count=" + count + ", snapshot time,"
                          + executionTime.TotalMilliseconds);
        return((long)executionTime.TotalMilliseconds);
    }
 /**
  * testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface.
  *
  * @return
  */
 public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface()
 {
     int count = 0;
     InvokeImpl invoke = new InvokeImpl();
     DateTime start = DateTime.Now;
     for (int i = NB_INSTANCE_REFLECTION_TESTS; i != 0; i--)
     {
         count = count + invoke.echoWithSetVariable("1").Length;
     }
     DateTime end = DateTime.Now;
     TimeSpan executionTime = end - start;
     Console.WriteLine("[ReflectionTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INSTANCE_REFLECTION_TESTS + " invoke.echoWithSetVariable(\"1\").length()  , count=" + count + ", snapshot time,"
         + executionTime.TotalMilliseconds);
     return (long) executionTime.TotalMilliseconds;
 }
 /**
  * testInvokeOfAnInstanceMethodWithoutInterface.
  *
  * @return
  */
 public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface()
 {
     int count = 0;
     InvokeImpl invoke = new InvokeImpl();
     DateTime start = DateTime.Now;
     for (int i = NB_INVOKE_SETTER_TESTS; i != 0; i--)
     {
         // Write to force jre not to optimize the code
         if (i % 2 == 0)
         {
             count = count + invoke.echoWithSetVariable("1").Length;
         }
         else
         {
             count = count + invoke.echoWithSetVariable("0").Length;
         }
     }
     DateTime end = DateTime.Now;
     TimeSpan executionTime = end - start;
     Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INVOKE_TESTS + " invoke.echoWithSetVariable(\"1\").Length, count=" + count + ", snapshot time,"
         + executionTime.TotalMilliseconds);
     return (long)executionTime.TotalMilliseconds;
 }
 /**
  * testInvokeOfAInstanceMethodWithInterface.
  *
  * @return
  */
 public static long testInvokeOfAnInstanceMethodWithGetInstanceVariableWithInterface()
 {
     int count = 0;
     Invoke invoke = new InvokeImpl();
     DateTime start = DateTime.Now;
     for (int i = NB_INVOKE_GETTER_TESTS; i != 0; i--)
     {
         // Write to force cpp not to optimize the code, never executed
         if (i % 2 == 2)
         {
             invoke.setEchoGet("1");
         }
         count = count + invoke.echoWithGetVariable().Length;
     }
     DateTime end = DateTime.Now;
     TimeSpan executionTime = end - start;
     Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Get Instance Variable With Interface " + NB_INVOKE_TESTS + " invoke.echoWithGetVariable().Length, count=" + count + ", snapshot time,"
         + executionTime.TotalMilliseconds);
     return (long)executionTime.TotalMilliseconds;
 }