Skip to content

Conversation

brad-kaiser
Copy link

The goal of this PR is to decrease Toree's startup time by breaking out the ScalaInterpreter initialization and running it in its own thread. If you count the startup time as the time it takes KernelBootstrap.initizalize to complete, I saw the average startup time go from 8.16s to 5.69s on my laptop. I started the kernel ten times with the original code and my changes.

Copy link
Contributor

@sanjay-saxena sanjay-saxena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on @brad-kaiser! Please see my comments.

import org.apache.toree.dependencies.{CoursierDependencyDownloader, Credentials, DependencyDownloader}
import org.apache.toree.interpreter._
import org.apache.toree.kernel.api.Kernel
import org.apache.toree.kernel.interpreter.scala.ScalaInterpreter
Copy link
Contributor

@sanjay-saxena sanjay-saxena Feb 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my limited understanding of the code, picking up a compile-time dependency on an implementation such as ScalaInterpreter from scala-interpreter project in the generic kernel project maybe an abstraction violation. It may also lead to circular dependencies. Maybe, you should look at either reusing the existing APIs on the generic trait Interpreter. And, if the existing APIs are not sufficient, then maybe add new APIs to the generic trait Interpreter.

import com.typesafe.config.Config
import org.apache.toree.interpreter._
import scala.collection.JavaConverters._
import org.apache.toree.kernel.interpreter.scala.ScalaInterpreter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about abstraction violation applies here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants