>>> hunk <file> <byte#> <line#> <#old bytes> <#old lines> <#new bytes> <#new 
>>> lines>
>>> old:
>>> <the old data>
>>> new:
>>> <the new data>
>>> end.

>> Question: do we want to allow for arbitrary amounts of padding in
>> order to page-align the data?  This might provide a slight performance
>> benefit when mmapping.

> That's already allowed by the lexing function dropping arbitrary
> whitespace before "old" and "new".

Hmm... my understanding is that with the new patch format, you just
mmap/read/gzread the patch file, check for the strings ``old:'',
``new:'' and ``end.'' at the right file offsets (which are implied by
the <#old bytes> and <#new bytes>), then extract the actual data.  There
is no lexing whatsoever -- you never even touch the mmapped pages
until you need the data.

What I'm thinking about is allowing two new fields, called say 
<#old padding> and <#new padding>, which allow arbitrary number of
bytes of padding before the strings ``old:'' and ``new:''.  This would
allow to optionally page align the data, which would save a page of
memory when mmapping.

> It would hurt us any time we needed lots of small hunks from one
> file at once, though.

We can always use 0 bytes of padding for small hunks.

> I'm doubtful it will be worth the added complexity of the patch
> writing code.

Yeah, you're probably right.

                                        Juliusz


_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to