Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOREE-463] break out scala interpreter initialization to speed up startup #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@@ -28,6 +28,7 @@ import org.apache.toree.comm.{CommManager, CommRegistrar, CommStorage, KernelCom
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.

@@ -20,15 +20,20 @@ package org.apache.toree.boot.layer
import org.apache.toree.kernel.api.KernelLike
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