spark-instrumented-optimizer/sql/core/benchmarks/MakeDateTimeBenchmark-results.txt
Maxim Gekk 02db706090 [SPARK-29115][SQL][TEST] Add benchmarks for make_date() and make_timestamp()
### What changes were proposed in this pull request?

Added new benchmarks for `make_date()` and `make_timestamp()` to detect performance issues, and figure out functions speed on foldable arguments.
- `make_date()` is benchmarked on fully foldable arguments.
- `make_timestamp()` is benchmarked on corner case `60.0`, foldable time fields and foldable date.

### Why are the changes needed?

To find out inputs where `make_date()` and `make_timestamp()` have performance problems. This should be useful in the future optimizations of the functions and users apps.

### Does this PR introduce any user-facing change?
No

### How was this patch tested?
By running the benchmark and manually checking generated dates/timestamps.

Closes #25813 from MaxGekk/make_datetime-benchmark.

Authored-by: Maxim Gekk <max.gekk@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
2019-09-17 15:09:16 -07:00

23 lines
2.1 KiB
Plaintext

Java HotSpot(TM) 64-Bit Server VM 1.8.0_202-b08 on Mac OS X 10.14.6
Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
make_date(): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
prepare make_date() 2149 2289 196 46.5 21.5 1.0X
make_date(2019, 9, 16) 1829 1868 58 54.7 18.3 1.2X
make_date(*, *, *) 3180 3339 139 31.4 31.8 0.7X
Java HotSpot(TM) 64-Bit Server VM 1.8.0_202-b08 on Mac OS X 10.14.6
Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
make_timestamp(): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
prepare make_timestamp() 2950 3025 96 0.3 2950.3 1.0X
make_timestamp(2019, 1, 2, 3, 4, 50.123456) 45 47 1 22.1 45.2 65.3X
make_timestamp(2019, 1, 2, 3, 4, 60.000000) 42 42 1 24.0 41.7 70.8X
make_timestamp(2019, 12, 31, 23, 59, 60.00) 41 42 1 24.2 41.3 71.4X
make_timestamp(*, *, *, 3, 4, 50.123456) 252 256 7 4.0 251.5 11.7X
make_timestamp(*, *, *, *, *, 0) 225 227 3 4.5 224.6 13.1X
make_timestamp(*, *, *, *, *, 60.0) 230 233 2 4.3 230.4 12.8X
make_timestamp(2019, 1, 2, *, *, *) 3078 3118 35 0.3 3078.5 1.0X
make_timestamp(*, *, *, *, *, *) 3092 3109 17 0.3 3092.4 1.0X