Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add benchmark
  • Loading branch information
yaooqinn committed Jun 27, 2024
commit 364537d74c339e0aacc07be3388ebf8f9ca17ef2
4 changes: 2 additions & 2 deletions sql/core/benchmarks/MathFunctionBenchmark-results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ OpenJDK 64-Bit Server VM 17.0.10+0 on Mac OS X 14.5
Apple M2 Max
BIN: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
------------------------------------------------------------------------------------------------------------------------
BIN 4935 4961 38 40.5 24.7 1.0X
BIN OLD 10170 10493 456 19.7 50.9 0.5X
BIN 6047 6056 13 16.5 60.5 1.0X
BIN OLD 12459 12526 96 8.0 124.6 0.5X

Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import org.apache.spark.sql.types.{DataType, LongType}
import org.apache.spark.unsafe.types.UTF8String

object MathFunctionBenchmark extends SqlBasedBenchmark {
private val N = 200L * 1000 * 1000
private val N = 100L * 1000 * 1000

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

benchmark.addCase("BIN OLD") { _ =>
spark.range(N).select(Column(BinOld(Column("id").expr))).noop()
spark.range(-N, N).select(Column(BinOld(Column("id").expr))).noop()
}
benchmark.run()
}
Expand Down