On Wednesday 30 Jul 2003 17:34, Niklas Bergh wrote:

> > > > But I must admit that single-file zipping would be a nicer way to do
> > > > it.
> >
> > I am more in favour of tar.bz2 format. It would be measurably more
> > compact for compressible data, with little speed penalty to speak of.
>
> As a windows user I am not too fond of that idea though....

A couple of things. Firstly, the tar/bzip2 tools are readily available for 
Windows, and if they are not, the functionality could be added to authoring 
tools, as the libraries are readily available.

Secondly, for single-file compression (completely separate from archive 
issue), you never need to worry about it. If each file is compressed 
individually, then that lives at a lower level than archives.

Here is what I propose. ZIP archives to be replaced with tar archives. Then, 
on a lower, "node" level, at insert time, the file being inserted is checked. 
If it's mime type or extension are indicative of compressed content, we 
simply insert the file as is. We do the same if the node is explicitly told 
not to compress the file, e.g. via a flag.

If the file still appears to be compressible after that (e.g. html, text, 
tar), bzip2 compression is applied to the file. The file is compressed and 
the pre/post compression size is checked. All files in Freenet are padded to 
the next power of 2 limit, so if the file after compression remains in the 
same size bracked (padded to the same power of 2 size), there is no point in 
compressing it. We just throw away the compressed file and insert it 
uncompressed.

This means that compression/decompression overhead is avoided where no 
space/bandwidth would be saved due to other design issues. Best of all 
worlds, I think.

However, there is something else I have been thinking about. Tar and bzip2 
would require extra Java libraries. They exist, but they would have to be 
bundled with Freenet. This would increase the download size, which is not 
desirable. ZIP handling is already built in, and would require no additional 
libraries. The downside is that it generally doesn't seem to compress as well 
as bz2, and sometimes the difference is quite noticable.

Thoughts please. :-)

Gordan
_______________________________________________
devl mailing list
[EMAIL PROTECTED]
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl

Reply via email to