hi,

Here's a new test. Even here the jboss socket comm (with/ without jboss 
serialization) does badly.The machines are the same linux boxes and no other 
process is runnin on it. 

First we ran the test for 1000 times(say this as a batch) and  15 such batches. 
Took the average of last 12 of them(considering jvm warmups etc). We did this 
for Java RMI with raw_socket (or javaRMI with java serialization) Then we did 
the same with Jboss RMI over socket (socket transport with jboss 
serialization). We did this as the same process and as a different processes. 
In all the cases socket transport with java serialization took abt 35% more 
time than java RMI with java serialization.

Now considering jboss RMI with jboss serialization it takes more than 10 times 
w.r.t. java RMI with java serialization. I am not sure where i am doing wrong. 
below is the code

public class Person implements Serializable {
  |     int                                             id;
  |     private Vector<Person>  personVector    = null;
  | 
  |         //HERE WE POPULATE A TREE WITH A GIVEN DEPTH AND BREADTH.
  |     public Person populateDepth(Person person, int currentDepth, int 
breadth, int finalDepth) {
  |             if (currentDepth >= finalDepth) {
  |                     return person;
  |             } else {
  |                     person.personVector = new Vector<Person>(breadth);
  |                     this.id = this.personID++;
  |                     for (int i = 0; i < breadth; i++) {
  |                             Person p = new Person();
  |                             person.personVector.add(p);
  |                             populateDepth(p, currentDepth + 1, breadth, 
finalDepth);
  |                     }
  |             }
  |             return person;
  |     }
  | 
  |        //DOES THE JAVA SERIALIZATION
  |     public byte[] getJavaBytes() throws Exception {
  |             ByteArrayOutputStream st = new ByteArrayOutputStream(64 * 1024);
  |             ObjectOutputStream os = new ObjectOutputStream(st);
  |             os.writeObject(this);
  |             byte[] s = st.toByteArray();
  |             return s;
  |     }
  | 
  |         //DOES JBOSS SERIALIZATION.
  |     public byte[] getJbossBytes() throws Exception {
  |             ByteArrayOutputStream st = new ByteArrayOutputStream(64 * 1024);
  |             ObjectOutputStream os = new JBossObjectOutputStream(st);
  |             os.writeObject(this);
  |             byte[] s = st.toByteArray();
  |             return s;
  |     }
  | 
  | //STRESS CODE
  | public static long stress(IRemote playerInterface, Person player, int hits) 
throws Exception {
  |             long startingTime;
  |             long endTime;
  |             startingTime = System.currentTimeMillis();
  |             for (int i = 0; i < hits; i++) {
  |                     Person result = playerInterface.execute(player);
  |             }
  |             endTime = System.currentTimeMillis();
  |             return endTime - startingTime;
  |     }
  | 
  | }
  | 
  | 

Also we see Jboss serialization to produce 40% more bytes than java 
serialization for the above prog.


Cleint prog is as follows


  | uri= "socket://10.1.131.96:8092?serializationtype=jboss";
  | int depth=15;
  | int breadth =2;
  | remote = (IRemote) TransporterClient.createTransporterClient(uri, 
IRemote.class);
  | Person p = new Person();
  | p = p.populateDepth(p, 0, breadth, depth);
  | return Person.stress(remote, p, hits);
  | 
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261694#4261694

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261694
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to