From: Robin Rosenberg Date: Wed, 28 Feb 2007 22:26:21 GMT Subject: [EGIT PATCH 3/9] Use mmap per default. Message-ID: <20070228222621.12021.65339.stgit@lathund.dewire.com> In-Reply-To: <20070228222355.12021.13029.stgit@lathund.dewire.com> A small test of mine show a tenfold speed improvemnt looking for a blob while scanning the history (11K commit, blob three trees down). This was on a x86 platform. For other platforms Shawn noted that memory mapping was about 10% slower than normall reading of files. Signed-off-by: Robin Rosenberg --- .../src/org/spearce/jgit/lib/PackFile.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java index ee4b8a1..d33aa97 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java @@ -42,7 +42,7 @@ public class PackFile { repo = parentRepo; // FIXME window size and mmap type should be configurable pack = new WindowedFile(repo.getWindowCache(), packFile, - 64 * 1024 * 1024, false); + 64 * 1024 * 1024, true); try { readPackHeader(); @@ -53,7 +53,7 @@ public class PackFile { + ".idx"); // FIXME window size and mmap type should be configurable idx = new WindowedFile(repo.getWindowCache(), idxFile, - 64 * 1024 * 1024, false); + 64 * 1024 * 1024, true); try { idxHeader = readIndexHeader(); } catch (IOException ioe) {