On 9/17/2010 12:01 AM, Ralph Versteegen wrote:
On 17 September 2010 15:46, Mike Caron<caron.m...@gmail.com>  wrote:
On 9/16/2010 11:43 PM, subvers...@hamsterrepublic.com wrote:

teeemcee
2010-09-16 20:43:54 -0700 (Thu, 16 Sep 2010)
372
Last minute change to the zonemap file format: switch to a span-based
format (as already documented on the Wiki)

This format is easier to write, but surprising slower to read and write
(about half), and the file size is now mostly RELOAD overhead (wish Mike
hadn't rejected my suggestions for better space efficiency).

Which ones were those? :S

-Use a VLI instead of an INT for node size. Even if you reserve 4
bytes whenever the node has any children, and then write the size
later, you can probably use a single byte for leaf nodes.

Except, the reason I use four bytes is because:

1. It's very difficult to "slide" the rest of the file over to get rid of the extra space. Even if that were easy,
2. It would create a cascading effect on the sizes of all other nodes.

Both those problems would be solved if we rendered the file into memory first, but I'm not particularly enthused about writing this code.

-Add a bit to the type byte that indicates whether or not there are
any children, so that you can skip the VLI for number of children for leaves.

This is reasonable, since I don't foresee having to add any new types.

Those reduce the overhead from 7 bytes per leaf to 3. So if the
average size of a .Z 'spans' data node is 3 bytes (guessing), it's a
significant saving.

> I forgot that strings also have a size VLI, so it's actually 8 vs. 4.

I agree that it's significant.

An alternative, however, might be to forgo the size counts entirely. The reason they exist is to allow efficient scanning of the file in cases where you only care about part of the file. However, this is impossible with the current API, so...

Proposal: Bump the version to 2 and omit the size parameters entirely. Thoughts?

Also finally added zonemap support to map resizing.
---
U   wip/loading.bas
U   wip/loading.bi
U   wip/mapsubs.bas
_______________________________________________
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

_______________________________________________
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to