Archive for February, 2009

Suboptimal compression with .Net’s GZipStream

I played around a bit with one of the .Net framework’s compression classes (System.IO.Compression.GZipStream) recently and got some unexpected results. First, the module is a bit weird in how in takes in and outputs data (e.g. for decompression you read directly from the GZipStream, but for compression you read from a MemoryStream), but once you get past this you run into a more significant issue: the compression library is not optimal and, in certain cases, the size of the “compressed” data can be significantly larger than that of the uncompressed input. I did a few ad-hoc and very unscientific tests, but they were good enough to give an indication that there was a problem. GZipStream is probably still good enough when there’s highly compressible data, but for situations where you don’t have any idea of what’s being compressed it’s probably best to look for another solution.

There’s a thread on MSDN about this issue (System.IO.Compression not as good as compressed folder) and also a feedback entry on MS Connect.

Fragment Sync screenshots

These were posted a while back on the Fragment Sync site.

Fragment Sync main screen Fragment Sync sync mapping screen Fragment Sync sync screen Fragment Sync sync results screen

Virtualizing socket ports per user

I haven’t put a whole lot of thought into this, so there may be something major I’m overlooking. In any case, I was thinking that virtualizing socket ports per user in a multiuser operating system would be a very cool and worthwhile feature. Doing this would allow applications running under different users to bind to the same port. So, two users running an app with a server component could both accept incoming connections and function simultaneously and independently.

Now, the obvious question here is how would this map to an IP address seen on the local network. A lesson from virtualizing operating systems could be taken here: treat every user as a different machine on the network, so every user instance gets it’s own IP (set manually, assigned by DHCP via. a router, or whatever) and you could (I think) fake the MAC address easily.

There’s the obvious performance loss, but w/ current processors that should be fairly minimal, even for heavy traffic.