caican00 opened a new pull request, #37609:
URL: https://github.com/apache/spark/pull/37609

   ### What changes were proposed in this pull request?
   `Traversable.toMap` changed to `collections.breakOut`, that eliminates 
intermediate tuple collection creation.
   I optimized it with reference to this 
pr:https://github.com/apache/spark/pull/18693
   An introduction to `Collections. BreakOut` can be found at [Stack Overflow 
article](https://stackoverflow.com/questions/1715681/scala-2-8-breakout).
   
   ### Why are the changes needed?
   When `DeserializeToObject` is executed, converting Tuple2 to Scala Map via 
`. ToMap` takes a lot of cpu time.
   
![image](https://user-images.githubusercontent.com/94670132/185860416-f147ddd7-65b3-4dcb-b9d6-9a872015e003.png)
   
![image](https://user-images.githubusercontent.com/94670132/185860432-2aec4c48-898a-4d66-8d34-2221ab7e9408.png)
   
   
   ### How was this patch tested?
   Unit tests run.
   No performance tests performed yet.


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