[TOREE-463] break out scala interpreter initialization to speed up startup#151
Open
brad-kaiser wants to merge 1 commit intoapache:masterfrom
Open
[TOREE-463] break out scala interpreter initialization to speed up startup#151brad-kaiser wants to merge 1 commit intoapache:masterfrom
brad-kaiser wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
sanjay-saxena
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Same comment about abstraction violation applies here as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.