diff options
author | roberto <roberto.tyley@guardian.co.uk> | 2010-12-09 23:40:34 +0000 |
---|---|---|
committer | roberto <roberto.tyley@guardian.co.uk> | 2010-12-09 23:46:47 +0000 |
commit | 941b3d8a8105333ccbc15e3b57574fce6da6f006 (patch) | |
tree | 1696100d15d2655e2e70c5efc8cdac646599cdb5 /org.eclipse.jgit.ui | |
parent | c181e1ab8ac52ff8ce02f95affc8f79cfbfff323 (diff) | |
download | jgit-941b3d8a8105333ccbc15e3b57574fce6da6f006.tar.gz jgit-941b3d8a8105333ccbc15e3b57574fce6da6f006.zip |
IndexPack: Remove blob-streaming size threshold
Always use streaming (for SHA-checksum & collision detection)
when indexing whole blobs, regardless of their size.
Positives:
* benefits of bugfix #312868 will apply to all runtimes, without
additional conf for mem-constrained JVMs (5MB huge for some)
* no byte array allocation
(re-uses readBuffer instead of allocating new full-size array)
* mildly better overall performance
(given the usual blob-does-not-need-collision-checking case)
* removes unnecessary code
Negative:
* doubles the disk IO for a blob comparision
(comparitively rare occurance)
I perf-tested a range of threshold sizes against a random selection
of packfiles I found on my harddrive, the results are here:
https://spreadsheets.google.com/ccc?key=tLCQElyyd2RKN9QevfvgwGQ&hl=en_GB#gid=1
My interpretation of the results is that the streaming size threshold
isn't beneficial (actually seems to be very slightly detrimental) -so
we should just get rid of it. This tallies with some of the comments
Shawn & I had for the default value of streamFileThreshold in the
review for I862afd4c:
http://egit.eclipse.org/r/#patch,sidebyside,2040,2,org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
The perf-test code is here: https://gist.github.com/735402
It's a bit scruffy but basically does 10 runs (in randomised order)
for each threshold size on various packfiles, waiting a second
between each pack-indexing to allow GC to catch up. I know it's not
perfect - proper perf testing is hard to do :-)
Diffstat (limited to 'org.eclipse.jgit.ui')
0 files changed, 0 insertions, 0 deletions