Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Java Tip 65: Measure data transfer speeds via Sun's ORB in JDK 1.2 beta 4

Determine effective data transfer speeds between client and server using CORBA

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Page 3 of 3

The difference represents the elapsed time since the client submitted the array to the server until the server acknowledges it. The difference is then submitted to the standard output.

class ViewServant extends _ViewImplBase {
/*---------------------------------------------------------*/
    ViewServant () {
        System.out.println("ViewServant() exiting.");
    }
/*---------------------------------------------------------*/
   public void send_byte (long time_start, int n, byte[] array) {
        System.out.println ("send_byte: entered.");
        long time_diff, time_0;
        time_0 = System.currentTimeMillis();
        time_diff = time_0 - time_start;
        System.out.println ("Time to xfer " + n + "BYTEs: " + time_diff + "
(ms)");
        System.out.println ("send_byte: exiting.");
    }
/*---------------------------------------------------------*/
   public void send_int (long time_start, int n, int[] array) {
        System.out.println ("send_int: entered.");
        long time_diff, time_0;
        time_0 = System.currentTimeMillis();
        time_diff = time_0 - time_start;
        System.out.println ("Time to xfer " + n + "INTs: " + time_diff + "
(ms)");
        System.out.println ("send_int: exiting.");
    }
/*---------------------------------------------------------*/
   public void send_double (long time_start, int n, double[] array) {
        System.out.println ("send_double: entered.");
        long time_diff, time_0;
        time_0 = System.currentTimeMillis();
        time_diff = time_0 - time_start;
        System.out.println ("Time to xfer " + n + "DOUBLEs: " + time_diff + "
(ms)");
        System.out.println ("send_double: exiting.");
    }
/*---------------------------------------------------------*/
   public void send_float (long time_start, int n, float[] array) {
        System.out.println ("send_float: entered.");
        long time_diff, time_0;
        time_0 = System.currentTimeMillis();
        time_diff = time_0 - time_start;
        System.out.println ("Time to xfer " + n + "FLOATs: " + time_diff + "
(ms)");
        System.out.println ("send_float: exiting.");
    }
}


Conclusion

The decision to use CORBA should depend on the data transfer speeds between the client and the server running on the desirable platforms. The reader can use the Java IDL implementation or other CORBA implementations and compare results. Hopefully, this Java Tip has given you something to build on when benchmarking application-specific data types and data sizes.

About the author

Jos� Barros is a senior consultant at Shell Services International, where he works on systems integration, computational methods for seismic processing and seismic interpretation, and prototyping with Java in his spare time. He has a PhD in Computer Science from the University of Texas at Dallas.
  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources
  • More information on CORBA can be found at the OMG site http://www.omg.org