All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [JGIT PATCH] Combine WindowedFile into PackFile to simplify the internals
Date: Thu, 23 Apr 2009 00:56:04 +0200	[thread overview]
Message-ID: <200904230056.05424.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <1240421616-14662-1-git-send-email-spearce@spearce.org>

onsdag 22 april 2009 19:33:36 skrev "Shawn O. Pearce" <spearce@spearce.org>:
> 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

      reply	other threads:[~2009-04-22 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 17:33 [JGIT PATCH] Combine WindowedFile into PackFile to simplify the internals Shawn O. Pearce
2009-04-22 22:56 ` Robin Rosenberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200904230056.05424.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.