]> source.dussan.org Git - jgit.git/commit
DirCacheEntry: Speed up creation by avoiding string cast 16/61516/1
authorShawn Pearce <spearce@spearce.org>
Sat, 28 Nov 2015 16:58:15 +0000 (08:58 -0800)
committerShawn Pearce <spearce@spearce.org>
Sat, 28 Nov 2015 17:01:03 +0000 (09:01 -0800)
commit761814fe9c3fc0503d4654ef4aace6a804da5ae7
treee508cc1b119e4f3d10c6bc4897e1be494edf2a7c
parent885879ffe907a5df1c6fcc40ef6972e27dfecdd6
DirCacheEntry: Speed up creation by avoiding string cast

The checkPath function is available as a byte[] form, in fact the
String form just converts to byte[] to run the algorithm.

Having DirCacheEntry take a byte[] -> String -> byte[] to check if
each path is valid is a huge waste of CPU time. On some systems it
can double the time required to read 38,999 files from trees to the
DirCache. This slows down any operation using a DirCache.

Expose the byte[] form and use it for DirCacheEntry creation.

Change-Id: I6db7bc793ece99ff3c356338d793c07c061aeac7
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java