spark-instrumented-optimizer/sql/core/benchmarks/IntervalBenchmark-results.txt
Maxim Gekk 6ffec5e6a6 [SPARK-29533][SQL][TEST] Benchmark casting strings to intervals
### What changes were proposed in this pull request?
Added new benchmark `IntervalBenchmark` to measure performance of interval related functions. In the PR, I added benchmarks for casting strings to interval. In particular, interval strings with `interval` prefix and without it because there is special code for this da576a737c/common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java (L100-L103) . And also I added benchmarks for different number of units in interval strings, for example 1 unit is `interval 10 years`, 2 units w/o interval is `10 years 5 months`, and etc.

### Why are the changes needed?
- To find out current performance issues in casting to intervals
- The benchmark can be used while refactoring/re-implementing `CalendarInterval.fromString()` or `CalendarInterval.fromCaseInsensitiveString()`.

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

### How was this patch tested?
By running the benchmark via the command:
```shell
SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain org.apache.spark.sql.execution.benchmark.IntervalBenchmark"
```

Closes #26189 from MaxGekk/interval-from-string-benchmark.

Authored-by: Maxim Gekk <max.gekk@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
2019-10-22 10:47:04 +09:00

26 lines
2.7 KiB
Plaintext

Java HotSpot(TM) 64-Bit Server VM 1.8.0_202-b08 on Mac OS X 10.15
Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
cast strings to intervals: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
string w/ interval 420 435 18 2.4 419.8 1.0X
string w/o interval 359 365 10 2.8 358.7 1.2X
1 units w/ interval 752 759 8 1.3 752.0 0.6X
1 units w/o interval 762 766 4 1.3 762.0 0.6X
2 units w/ interval 961 970 8 1.0 960.7 0.4X
2 units w/o interval 970 976 9 1.0 970.2 0.4X
3 units w/ interval 1130 1136 7 0.9 1130.4 0.4X
3 units w/o interval 1150 1158 9 0.9 1150.3 0.4X
4 units w/ interval 1333 1336 3 0.7 1333.5 0.3X
4 units w/o interval 1354 1359 4 0.7 1354.5 0.3X
5 units w/ interval 1523 1525 2 0.7 1523.3 0.3X
5 units w/o interval 1549 1551 3 0.6 1549.4 0.3X
6 units w/ interval 1661 1663 2 0.6 1660.8 0.3X
6 units w/o interval 1691 1704 13 0.6 1691.2 0.2X
7 units w/ interval 1811 1817 8 0.6 1810.6 0.2X
7 units w/o interval 1853 1854 1 0.5 1853.2 0.2X
8 units w/ interval 2029 2037 8 0.5 2028.7 0.2X
8 units w/o interval 2075 2075 1 0.5 2074.5 0.2X
9 units w/ interval 2170 2175 5 0.5 2170.0 0.2X
9 units w/o interval 2204 2212 8 0.5 2203.6 0.2X