Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Low-latency alternative to Java Object Serialization Date: Sun, 02 Oct 2011 11:07:01 +0200 Lines: 53 Message-ID: <9eqntkFp1cU1@mid.individual.net> References: <23089865.2265.1317485980290.JavaMail.geo-discussion-forums@preb19> <9ep735Fhr8U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net eILJ7tkEOWKZJncNrUdiMwbjt4jNJsdrqu1pjhGEd5xUYAAxE= Cancel-Lock: sha1:/FCNIW/AtGRd2OQQs2GVvw1OwfM= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: X-Antivirus: avast! (VPS 111001-1, 01.10.2011), Outbound message X-Antivirus-Status: Clean Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8477 On 01.10.2011 21:35, jebblue wrote: > On Sat, 01 Oct 2011 21:13:40 +0200, Robert Klemme wrote: > >> On 10/01/2011 06:19 PM, Lew wrote: >>> Giovanni Azua wrote: >>>> I have this lite Client-Server framework based on Blocking IO using >>>> classic java.net.* Sockets (must develop it myself for a grad course >>>> project). The way I am using to pass data over the Sockets is via >>>> Serialization i.e. ObjectOutputStream#writeObject(...) and >>>> ObjectInputStream#readObject(...) I was wondering if anyone can >>>> recommend a Serialization framework that would outperform the vanilla >>>> Java default Serialization? >>>> >>> But you will be transmitting data via a format that omits the object >>> graph overhead and focuses on just the data to share. The object-graph >>> knowledge is coded into the application and need not be transferred. >>> >>> XML is awesome for this kind of task. >> >> http://www.json.org/ might also be a good alternative which - depending >> on format etc. - can be less verbose. See http://json.org/example.html >> > > JSON is convenient for JavaScript heads, it is not human readable, > this is one reason why XML exists in the first place. I am not sure why you say JSON is not human readable while XML is. Remember: for network transfer you would use the most compressed format of either which means that for XML you would not have line breaks and indentation. I'd say an XML on one line with a reasonable complex structure is not human readable. > JSON was > a mistake, instead of coming up with an arcane hacked syntax > to replace XML; JavaScript should have been improved to handle > XML. That sounds like opinion to me. Can you provide any real arguments why XML should be chosen for as a data transfer format over JSON? XML does have some overhead and often uses more bytes to represent the same structure. There's also an interesting discussion at stackoverflow: http://stackoverflow.com/questions/2636245/choosing-between-json-and-xml#2636380 Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/