LuciferYang commented on code in PR #39286:
URL: https://github.com/apache/spark/pull/39286#discussion_r1059739529


##########
core/src/main/scala/org/apache/spark/status/protobuf/DeterministicLevelSerializer.scala:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.status.protobuf
+
+import org.apache.spark.rdd.DeterministicLevel
+import org.apache.spark.status.protobuf.StoreTypes.{DeterministicLevel => 
GDeterministicLevel}
+
+private[protobuf] object DeterministicLevelSerializer {
+
+  def serialize(input: DeterministicLevel.Value): GDeterministicLevel = {

Review Comment:
   A simple test is as follows:
   
   
https://github.com/LuciferYang/spark/commit/3d4dc25eb03ba35ad2497f2d1a2274300e1cc7ee
   
   run with GA: https://github.com/LuciferYang/spark/actions/runs/3816561346
   
   `case match` is slow:
   
   ```
   OpenJDK 64-Bit Server VM 1.8.0_352-b08 on Linux 5.15.0-1023-azure
   Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
   Test serialize:                           Best Time(ms)   Avg Time(ms)   
Stdev(ms)    Rate(M/s)   Per Row(ns)   Relative
   
------------------------------------------------------------------------------------------------------------------------
   Use map                                             192            195       
    3          5.2         192.4       1.0X
   Use case match                                      454            455       
    1          2.2         453.8       0.4X
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to