diff options
author | Josh Rosen <joshrosen@databricks.com> | 2016-08-30 09:58:00 +0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-08-30 09:58:00 +0800 |
commit | 48b459ddd58affd5519856cb6e204398b7739a2a (patch) | |
tree | 7533ffd9546261dff30edb0a193a7a5f32b3ce95 | |
parent | 736a7911cb0335cdb2b2f6c87f9e3c32047b5bbb (diff) | |
download | spark-48b459ddd58affd5519856cb6e204398b7739a2a.tar.gz spark-48b459ddd58affd5519856cb6e204398b7739a2a.tar.bz2 spark-48b459ddd58affd5519856cb6e204398b7739a2a.zip |
[SPARK-17301][SQL] Remove unused classTag field from AtomicType base class
There's an unused `classTag` val in the AtomicType base class which is causing unnecessary slowness in deserialization because it needs to grab ScalaReflectionLock and create a new runtime reflection mirror. Removing this unused code gives a small but measurable performance boost in SQL task deserialization.
Author: Josh Rosen <joshrosen@databricks.com>
Closes #14869 from JoshRosen/remove-unused-classtag.
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala index 65eae869d4..1981fd8f0a 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala @@ -17,13 +17,10 @@ package org.apache.spark.sql.types -import scala.reflect.ClassTag -import scala.reflect.runtime.universe.{runtimeMirror, TypeTag} +import scala.reflect.runtime.universe.TypeTag import org.apache.spark.annotation.DeveloperApi -import org.apache.spark.sql.catalyst.ScalaReflectionLock import org.apache.spark.sql.catalyst.expressions.Expression -import org.apache.spark.util.Utils /** * A non-concrete data type, reserved for internal uses. @@ -130,11 +127,6 @@ protected[sql] abstract class AtomicType extends DataType { private[sql] type InternalType private[sql] val tag: TypeTag[InternalType] private[sql] val ordering: Ordering[InternalType] - - @transient private[sql] val classTag = ScalaReflectionLock.synchronized { - val mirror = runtimeMirror(Utils.getSparkClassLoader) - ClassTag[InternalType](mirror.runtimeClass(tag.tpe)) - } } |