Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] insertUnpackedObject() perf regression: j.nio.file.Files.exists() 15x slower than j.io.File.exists()

On Fri, Aug 28, 2015 at 4:45 PM, Roberto Tyley <roberto.tyley@xxxxxxxxx> wrote:
A quick packaging of my BFG benchmark tool for the JGit team can be found here:


Clone this repo, and then grab the 1.2GB reference data: https://github.com/rtyley/bfg-bench#reference-data

Note that to do a serious test, you'll need to set up a ramdisk: https://github.com/rtyley/bfg-bench#ram-disk



The BFG and it's benchmark are built with SBT, which is obscure for many people, so for your convenience I've provided pre-compiled jars (including versions before and after Matthias's fix):


All versions of the BFG jar are identical (at https://github.com/rtyley/bfg-repo-cleaner/tree/c54757-benchmark-version), apart from the version of JGit they were built with.

I ran your benchmark on Mac with different Java versions. Times are in ms:

java 1.7.0_80 Oracle
JGit 3.7.1 JGit 3abf35b-nio JGit 05acf1c-io-fix
61 57 41
59 95 39
75 95 49
68 86 69
100 69 52
Mean 73 80 50
StdDev 14 14 10
java 1.8.0_60 Oracle
JGit 3.7.1 JGit 3abf35b-nio JGit 05acf1c-io-fix
74 53 57
67 71 59
67 67 66
73 69 48
78 62 48
Mean 72 64 56
StdDev 4 6 7
java 1.8.0_60 SAP
JGit 3.7.1 JGit 3abf35b-nio JGit 05acf1c-io-fix
47 46 82
65 74 57
93 62 54
68 73 77
84 89 58
Mean 72 69 65
StdDev 16 14 11

so it seems on Mac there is an advantage using File.exists() compared to NIOs exists()
On Java 8 the difference is small.

-Matthias
 

Back to the top