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

    https://github.com/apache/spark/pull/2868#discussion_r19508498
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala ---
    @@ -613,6 +684,14 @@ object DecisionTree extends Serializable with Logging {
               node.rightNode = Some(Node(Node.rightChildIndex(nodeIndex),
                 stats.rightPredict, stats.rightImpurity, rightChildIsLeaf))
     
    +          if (nodeIdCache.nonEmpty) {
    +            val nodeIndexUpdater = NodeIndexUpdater(
    +              split = split,
    +              nodeIndex = nodeIndex)
    +            nodeIdUpdaters(treeIndex) =
    +              nodeIdUpdaters(treeIndex) ++ Map(nodeIndex -> 
nodeIndexUpdater)
    --- End diff --
    
    Have you checked out timing to see if using a Map like this causes issues 
with garbage collection?  I'm wondering if using something like 
org.apache.spark.util.collection.OpenHashMap would be more efficient; you could 
construct the map using an OpenHashMap and then cast it to an immutable map.  
I've only tested locally so far, and it does not seem to be an issue.  But we 
can keep it in mind for distributed tests if we ever see that the internal 
timing for findBestSplits is significantly different from chooseSplits.


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