celeborn/common/benchmarks
Cheng Pan df3fc194fb
[CELEBORN-744] Add Benchmark framework and ComputeIfAbsentBenchmark
### What changes were proposed in this pull request?

The benchmark shows that `computeIfAbsent` still has better performance on simple case

```
================================================================================================
HashMap
================================================================================================

OpenJDK 64-Bit Server VM 1.8.0_332-b09 on Mac OS X 13.4.1
Apple M1 Pro
HashMap:                                  Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
putIfAbsent                                         701            702           0         95.7          10.4       1.0X
computeIfAbsent                                     534            535           1        125.6           8.0       1.3X

================================================================================================
ConcurrentHashMap
================================================================================================

OpenJDK 64-Bit Server VM 1.8.0_332-b09 on Mac OS X 13.4.1
Apple M1 Pro
ConcurrentHashMap:                        Best Time(ms)   Avg Time(ms)   Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
------------------------------------------------------------------------------------------------------------------------
putIfAbsent                                         712            716           3         94.2          10.6       1.0X
computeIfAbsent                                     702            705           2         95.6          10.5       1.0X
```

### Why are the changes needed?

Introduce a Benchmark framework for future performance sensitive case measurement.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass GA.

Closes #1657 from pan3793/CELEBORN-744.

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2023-06-29 20:19:30 +08:00
..
ComputeIfAbsentBenchmark-results.txt [CELEBORN-744] Add Benchmark framework and ComputeIfAbsentBenchmark 2023-06-29 20:19:30 +08:00