0 Replies Latest reply: Sep 24, 2010 2:43 AM by Hasnain Alibhai RSS

JBoss Serialization slower

Hasnain Alibhai Newbie

Hi,

 

I am currently measuring JBoss Serialization and everytime i run it against a bench mark it gives me 50% slower result. I might be doing something wrong here (so help would be really appreciated).

 

Info:

 

JDK 1.6

 

/**
* Converts an object to a serialized byte array.
*
* @param obj Object to be converted.
* @return byte[] Serialized array representing the object.
*/
public static byte[] getByteArrayFromObjectJBoss(Object obj) {
   byte[] result = null;
      
   try {
       ByteArrayOutputStream baos = new ByteArrayOutputStream();
       ObjectOutputStream oos = new JBossObjectOutputStream(baos);
       oos.writeObject(obj);
       oos.flush();
       oos.close();
       baos.close();
       result = baos.toByteArray();
   } catch (IOException ioEx) {
       Logger.getLogger("UtilityMethods").error("Error converting object to byteArray", ioEx);
   }
       
   return result;
}

I am also attaching files that I have made.

 

Thanks in advance,

 

//Hasnain