Montag, 25. Juli 2011

RLE - image encoding

As PNG was rather expensive for real-time image encoding, I implemented server-side RLE encoding. Compression for "typical" UIs yields about 120-200% the size of the equivalent png, however at a speed of about 300-1000mb/s on my 4 year old Notebook.

The data is sent to the client in binary format, and is decoded using JavaScript.
XHR1 for binary data transfer is also supported, but since XHR1 was never intended for binary-data-transfer it causes a performance hit.

IE9 was running on Win7 in Virtualbox (as all XHR1-Win7), however even under the same conditions, Opera/FireFox/Chrome were twice as fast.


mcloud hat gesagt…

With those FPS, I don't know how much high you're aiming for, but if it keeps that way, on some java apps you might get some kind of animated object which will kill the latency. Implementing some kind of frame-drop support might help there. Have you thought of using some kind of stream video format instead of plain images? theora & v8 comes to mind. Off couse, using javascript for it isn't praticable, but you might be able to provide something browser specific for some cases (firefox & chrome comes to mind)

Linuxhippy hat gesagt…

Frame drop support is inherent to the design. Those FPS are for a full main-window redraw, most of the time only small specific parts of a window change. E.g. you can even with IE9 navigate through JMenus without noticing any latency/slowness.

The problem wih streaming formats is they are all lossy, which you really don't want as soon as you work with text/glyphs. besides, anything is slower server-side than RLE ;)

Christiaan hat gesagt…

Hi Clemens,
we had some contact through the jdk forum some time ago (

Great to see you are still working on the idea of rendering a Swing application on a webserver! (at least it is my understanding that caciovallo will enable this). Did you leave the concept of translating swing components into webcomponents (UComponents) and went for sending graphics?

As mentioned in the post (which got lost), I took the approach of deploying our application through RDP, which already works well. With new developments in the HTML5 area, I also see new possibilities. Eg. thinRDP allows for an rdp connection through a webbrowser if it supports HTML5. So that would be the only client side requirement.

Do you still think you would have a better performance compared to an RDP / Citrix solution? I am currently setting it up, so if you like we could do a testcase;-)

kind regards,

Linuxhippy hat gesagt…

Hi Christiaan,

Of course I remember =)
I left the UIComponent concept because theres a commecial product which does exactly the same (, and I didn't have the resources to wrap all of swings functionality into my API.

Well, comparing cacio-web to RDP ... at least I see no reason why RDP should be faster - as it adds quite a few layers of software to the game. Furthermore cacio-web allows running multiple app instances per JVM :)

Christiaan hat gesagt…

MVM support? That is even better than I could hope for;-) Did you implement that yourself, or did Oracle finally start working on that? (I believe I heard Mark Reinhold mentioning it)

Is there anyway I can try this? I can find several blogs about it, but not an overall website. Or is this still something in a very early stage? Really cool development!

kind regards,

Linuxhippy hat gesagt…

No, not MVM ;) (as far as I remember that was actually implemented but did not make its way into JSE).

Its basically AppContext seperation, so a bit of care is required (e.g. static fields), but this could probably be solved with seperate classloaders.

Google Summer of Code deadline is 22th August, I'll provide a small demo package then for sure =)