Re: incrementally indexed headers should be inserted in index '0' instead of len(table)+1

On 15 August 2013 14:35, Roberto Peon <grmocg@gmail.com> wrote:
>
> The distance to the first appearance is algorithmically the wrong thing to do

Actually I think that you've got the wrong end there.  You are
thinking about the code that you built to assemble this particular
graph.  However, if you want compression, you want to reference a
table entry multiple times.  The longer it lives in the table, the
better the compression.  Therefore, the longer the distance, the
longer the period you get to reuse value over.

Of course it's more expensive to scan back to the first appearance.
But you aren't doing that when compressing, you are just scanning back
to the point where the entry lives in the header table.  The distance
to which is bounded by the amount of memory you are allocating to the
table.

That said, counting the number of times as opposed to the span of time
is probably better.

Received on Thursday, 15 August 2013 21:57:53 UTC