[EGIT PATCH 3/9] Use mmap per default.

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

 



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 <robin.rosenberg@xxxxxxxxxx>
---

 .../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) {
-
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]