Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Question on large object streams

On Wed, Oct 6, 2010 at 7:42 AM, Dmitry Neverov <dmitry.neverov@xxxxxxxxx> wrote:
>
> One more question on this: why can't we inflate base object and use
> RandomAccessFile to read from it?

I almost had that working.  We use a BufferedInputStream wrapped
around a FileInputStream, and use skip(long) to fast-forward to the
position we want.  In this case that translates into a seek system
call, which is the same as using RandomAccessFile.  But I added a new
interface that let me reset the file pointer to 0 through the
FileChannel.  On Linux this had no performance difference from just
closing the file and re-opening it.  But on Win32 that could actually
be pretty expensive.

Maybe instead of using the loose objects as our cache we need an
independent disk based delta base cache that stores the files as raw
content, rather than wrapped up in a zlib stream, so we can do random
seeks to match copy instructions.  This is a whole lot more code to
write, because we also need to manage pruning items from the cache to
prevent the disk usage from becoming too high.

-- 
Shawn.


Back to the top