Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16390#discussion_r93793605
  
    --- Diff: core/src/main/scala/org/apache/spark/ContextCleaner.scala ---
    @@ -58,7 +58,12 @@ private class CleanupTaskWeakReference(
      */
     private[spark] class ContextCleaner(sc: SparkContext) extends Logging {
     
    -  private val referenceBuffer = new 
ConcurrentLinkedQueue[CleanupTaskWeakReference]()
    +  /**
    +   * A buffer to ensure that `CleanupTaskWeakReference`s are not garbage 
collected as long as they
    +   * have not been handled by the reference queue.
    +   */
    +  private val referenceBuffer =
    +    new ConcurrentHashMap[CleanupTaskWeakReference, 
CleanupTaskWeakReference]()
    --- End diff --
    
    Since this PR is a performance improvement, I prefer to use 
`ConcurrentHashMap` which usually provides better performance.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to