-
1. Re: JBoss RMI + Serialization performance issue
ravi_eze Oct 22, 2009 7:53 AM (in response to ron_sigal)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 codepublic 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 followsuri= "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);
-
2. Re: JBoss RMI + Serialization performance issue
ron_sigal Nov 6, 2009 10:33 PM (in response to ron_sigal)One guess is that the use of a proxy, which is how transporters work, is adding some overhead. In our socket transport versus RMI performance, we used plain org.jboss.remoting.Client invocations.
"ravi_eze" wrote:
Now considering jboss RMI with jboss serialization it takes more than 10 times w.r.t. java RMI with java serialization.
Well, that's really bad. I just don't know what's going on.
By the way, what role is played by getJavaBytes() and getJavaBytes()?"ravi_eze" wrote:
Also we see Jboss serialization to produce 40% more bytes than java serialization for the above prog.
I have heard that JBossSerialization sometimes uses more space than Java serialization.