diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2020-06-05 13:01:11 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2020-06-06 11:10:35 +0200 |
commit | 8a44216e8bdad1a13ce637b1395467600870849a (patch) | |
tree | e702cd7071b7585c842326ef0a394e519e55f74d /org.eclipse.jgit.ant | |
parent | 001d747419a87e1431e6aae3f1e815f843ee6e51 (diff) | |
download | jgit-8a44216e8bdad1a13ce637b1395467600870849a.tar.gz jgit-8a44216e8bdad1a13ce637b1395467600870849a.zip |
Add benchmark for strategies how to move a file
We can either
- try moving the file and, in case the target directory doesn't exist,
handle the NoSuchFileException this raises to create the target
directory
- or we always first test if the target directory exists and create it
in case it is missing
On my Mac this yields
Benchmark Mode Cnt Score Error Units
FileMoveBenchmark.moveFileToExistingDir avgt 5 196.490 ± 15.194 us/op
FileMoveBenchmark.moveFileToExistingDirExists avgt 5 223.217 ± 54.816 us/op
FileMoveBenchmark.moveFileToMissingDir avgt 5 332.169 ± 43.871 us/op
FileMoveBenchmark.moveFileToMissingDirExists avgt 5 303.815 ± 137.568 us/op
This means if the target directory of the move already exists the
first strategy is faster by around 25 us/op otherwise the second one
is faster by around 30 us/op. Which one is favorable depends on the
average probability that the target directory exists in real world
scenarios.
Change-Id: I03653b408b859a796508dfa1471b36c65633534e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.ant')
0 files changed, 0 insertions, 0 deletions