Re: [JGIT PATCH] Combine WindowedFile into PackFile to simplify the internals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



onsdag 22 april 2009 19:33:36 skrev "Shawn O. Pearce" <spearce@xxxxxxxxxxx>:
> The only user of WindowedFile is PackFile, and it did so by making
> an anonymous inner subclass within its constructor.  This is simply
> too confusing to work with.  The two classes are tightly integrated
> and work together to implement pack access.  Half of WindowedFile
> is just exposing accessors for PackFile to call through.
Thanks for clearing that out.

Nested classes are E-V-I-L. For UI-code you cannot sanely get away,
without them, where they are typically used more like an approximation
of closures and anonymous functions so the yield is high. In most
places they just confuse.

> Long ago both PackFile and PackIndex used WindowedFile to read
> data on demand, so having the WindowedFile class made some degree
> of sense.  But in 667a84b6997e9048e0771168c98d2ffbca791937 (almost 2
> years ago) Robin changed the pack index data to be read in one shot,
> as that performed better than paging in the index on demand.

The really real reason was that on Windows the index was locked when
mapped until the Great Collector kicks in, with no way of forcing unlock. 
Faster or not, using memory mapping was simply not possible for the
index or any file that must be rewritten from time to time. That it was
faster is perhaps not so strange since a few big I/O's presumably takes
less time than many small.

-- robin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]