jgit/org.eclipse.jgit.benchmarks/src/org/eclipse/jgit/benchmarks
Matthias Sohn 8a44216e8b 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>
2020-06-06 11:10:35 +02:00
..
CreateFileSnapshotBenchmark.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
FileMoveBenchmark.java Add benchmark for strategies how to move a file 2020-06-06 11:10:35 +02:00
LookupFileStoreBenchmark.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
SimpleLruCacheBenchmark.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00