0lai0 commented on code in PR #5216:
URL: https://github.com/apache/datafusion-comet/pull/5216#discussion_r3740961790


##########
spark/src/main/scala/org/apache/spark/sql/comet/DecimalPrecision.scala:
##########
@@ -40,6 +40,24 @@ import org.apache.spark.sql.types.DecimalType
  */
 object DecimalPrecision {
   def promote(expr: Expression): Expression = {
+    // `transformUp` walks and rebuilds every node even when no case matches, 
and the serde calls
+    // this once per expression it converts, so skip it when there is nothing 
to rewrite.

Review Comment:
   Nit: Could you reword this comment slightly? 
   `transformUp` does call mapChildren at every node, but specialized 
mapChildren (UnaryLike / BinaryLike / etc.) skip the copy via fastEquals when 
nothing changed , so it doesn't really "rebuild every node". 
   The cost is the traversal + allocations (`children.map` / 
`mapProductIterator`). 
   The PR body's wording already captures this well; matching that here would 
help future profilers. 
   



-- 
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