stripe-archive / brushfire

Distributed decision tree ensemble learning in Scala
Other
391 stars 50 forks source link

Erik non lazy initialization #88

Closed erik-stripe closed 8 years ago

erik-stripe commented 8 years ago

This is a small change that improves the efficiency of our traversals.

@jvns noticed that accessing the lazy val function instances was slowing down our traversals. In this case (since they are local variables only used by one thread) we can replace the lazy val variables with var variables which we initialize as soon as it is legal (we can't use val due to an overly-cautious circularity check done by scalac).

The tests pass and @jvns has verified that this branch seems to improve the performance of the traversals.

?r @tixxit @jvns @avibryant

tixxit commented 8 years ago

:+1: