Skip to content

Commit 364537d

Browse files
committed
add benchmark
1 parent d43789f commit 364537d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sql/core/benchmarks/MathFunctionBenchmark-results.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ OpenJDK 64-Bit Server VM 17.0.10+0 on Mac OS X 14.5
22
Apple M2 Max
33
BIN: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
44
------------------------------------------------------------------------------------------------------------------------
5-
BIN 4935 4961 38 40.5 24.7 1.0X
6-
BIN OLD 10170 10493 456 19.7 50.9 0.5X
5+
BIN 6047 6056 13 16.5 60.5 1.0X
6+
BIN OLD 12459 12526 96 8.0 124.6 0.5X
77

sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MathFunctionBenchmark.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ import org.apache.spark.sql.types.{DataType, LongType}
2525
import org.apache.spark.unsafe.types.UTF8String
2626

2727
object MathFunctionBenchmark extends SqlBasedBenchmark {
28-
private val N = 200L * 1000 * 1000
28+
private val N = 100L * 1000 * 1000
2929

3030
override def runBenchmarkSuite(mainArgs: Array[String]): Unit = {
3131
val benchmark = new Benchmark("BIN", N, output = output)
3232
benchmark.addCase("BIN") { _ =>
33-
spark.range(N).select(Column(Bin(Column("id").expr))).noop()
33+
spark.range(-N, N).select(Column(Bin(Column("id").expr))).noop()
3434
}
3535

3636
benchmark.addCase("BIN OLD") { _ =>
37-
spark.range(N).select(Column(BinOld(Column("id").expr))).noop()
37+
spark.range(-N, N).select(Column(BinOld(Column("id").expr))).noop()
3838
}
3939
benchmark.run()
4040
}

0 commit comments

Comments
 (0)