Skip to content

Commit

Permalink
Removing dependencies to speed up startup (#10249)
Browse files Browse the repository at this point in the history
Reducing the number of dependencies. Explicit `cats` are almost gone (present in `cli`). `enumeration` is completely gone.  `cats` is also still included implicitly via `io.circe` but that's a different kind of beast.
Also, really removed `jackson` from dependencies by fixing the dependency on `http-test-helper`.

# Important Notes
In a number of places importing all cats implicits could be simply replaced with a single or two method calls. Not to mention that this will reduce compilation times due to reduced implicit search space.

One example of how the changes affect performance (not only startup):

Before:
![Screenshot from 2024-06-11 12-05-24](https://github.com/enso-org/enso/assets/292128/a1a772a9-635d-4a16-a543-e2fd2124a22c)
Now:
![Screenshot from 2024-06-11 14-27-47](https://github.com/enso-org/enso/assets/292128/b17c7fcc-9a6d-48b9-8200-60708354ee03)
(frequently executed)

![Screenshot from 2024-06-12 12-46-34](https://github.com/enso-org/enso/assets/292128/31bc4dfd-4edc-45c9-9c5d-13e3472089b9)
Also appears to be gone.

This PR is by no means finished. The purge will continue in follow up PRs.
  • Loading branch information
hubertp authored Jun 12, 2024
1 parent aaf0e3d commit d6d3709
Show file tree
Hide file tree
Showing 227 changed files with 450 additions and 11,562 deletions.
15 changes: 3 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ val catsVersion = "2.9.0"

val circeVersion = "0.14.5"
val circeYamlVersion = "0.14.2"
val enumeratumCirceVersion = "1.7.2"
val circeGenericExtrasVersion = "0.14.2"
val circe = Seq("circe-core", "circe-generic", "circe-parser")
.map("io.circe" %% _ % circeVersion)
Expand Down Expand Up @@ -620,7 +619,6 @@ lazy val `text-buffer` = project
.settings(
frgaalJavaCompilerSetting,
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scalacheck" %% "scalacheck" % scalacheckVersion % Test
)
Expand Down Expand Up @@ -924,8 +922,7 @@ lazy val cli = project
version := "0.1",
libraryDependencies ++= circe ++ Seq(
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.typelevel" %% "cats-core" % catsVersion
"org.scalatest" %% "scalatest" % scalatestVersion % Test
),
Test / parallelExecution := false
)
Expand All @@ -936,8 +933,7 @@ lazy val `task-progress-notifications` = project
.settings(
version := "0.1",
libraryDependencies ++= Seq(
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test
"org.scalatest" %% "scalatest" % scalatestVersion % Test
),
Test / parallelExecution := false
)
Expand Down Expand Up @@ -1003,7 +999,6 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager"))
"commons-cli" % "commons-cli" % commonsCliVersion,
"commons-io" % "commons-io" % commonsIoVersion,
"org.apache.commons" % "commons-lang3" % commonsLangVersion,
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
"com.miguno.akka" %% "akka-mock-scheduler" % akkaMockSchedulerVersion % Test,
"org.mockito" %% "mockito-scala" % mockitoScalaVersion % Test,
"junit" % "junit" % junitVersion % Test,
Expand Down Expand Up @@ -1497,7 +1492,6 @@ lazy val `language-server` = (project in file("engine/language-server"))
"io.circe" %% "circe-generic-extras" % circeGenericExtrasVersion,
"io.circe" %% "circe-literal" % circeVersion,
"dev.zio" %% "zio" % zioVersion,
"com.beachape" %% "enumeratum-circe" % enumeratumCirceVersion,
"com.google.flatbuffers" % "flatbuffers-java" % flatbuffersVersion,
"commons-io" % "commons-io" % commonsIoVersion,
"com.github.pureconfig" %% "pureconfig" % pureconfigVersion,
Expand Down Expand Up @@ -2518,7 +2512,6 @@ lazy val `engine-runner` = project
"commons-cli" % "commons-cli" % commonsCliVersion,
"com.monovore" %% "decline" % declineVersion,
"org.jline" % "jline" % jlineVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"junit" % "junit" % junitVersion % Test,
"com.github.sbt" % "junit-interface" % junitIfVersion % Test,
"org.scala-lang.modules" %% "scala-collection-compat" % scalaCollectionCompatVersion
Expand Down Expand Up @@ -2668,7 +2661,6 @@ lazy val launcher = project
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
libraryDependencies ++= Seq(
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"org.apache.commons" % "commons-compress" % commonsCompressVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
akkaSLF4J
Expand Down Expand Up @@ -2987,7 +2979,7 @@ lazy val downloader = (project in file("lib/scala/downloader"))
)
)
.dependsOn(cli)
.dependsOn(`http-test-helper`)
.dependsOn(`http-test-helper` % "test->test")
.dependsOn(testkit % Test)

lazy val `edition-updater` = project
Expand Down Expand Up @@ -3093,7 +3085,6 @@ lazy val `runtime-version-manager` = project
resolvers += Resolver.bintrayRepo("gn0s1s", "releases"),
libraryDependencies ++= Seq(
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"org.apache.commons" % "commons-compress" % commonsCompressVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
akkaHttp
Expand Down
55 changes: 0 additions & 55 deletions distribution/engine/THIRD-PARTY/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,11 @@ The license file can be found at `licenses/GNU_Lesser_General_Public_License`.
Copyright notices related to this dependency can be found in the directory `ch.qos.logback.logback-core-1.3.7`.


'enumeratum-circe_2.13', licensed under the MIT, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.beachape.enumeratum-circe_2.13-1.7.2`.


'enumeratum-macros_2.13', licensed under the MIT, is distributed with the engine.
The license file can be found at `licenses/MIT`.
Copyright notices related to this dependency can be found in the directory `com.beachape.enumeratum-macros_2.13-1.6.3`.


'enumeratum_2.13', licensed under the MIT, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.beachape.enumeratum_2.13-1.7.2`.


'shapeless_2.13', licensed under the Apache 2, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.chuusai.shapeless_2.13-2.3.10`.


'jackson-annotations', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.core.jackson-annotations-2.15.2`.


'jackson-core', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.core.jackson-core-2.15.2`.


'jackson-databind', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `com.fasterxml.jackson.core.jackson-databind-2.15.2`.


'jsoniter-scala-core_2.13', licensed under the MIT License, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `com.github.plokhotnyuk.jsoniter-scala.jsoniter-scala-core_2.13-2.28.5`.
Expand Down Expand Up @@ -176,21 +146,11 @@ The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `commons-codec.commons-codec-1.16.0`.


'commons-codec', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `commons-codec.commons-codec-1.9`.


'commons-io', licensed under the Apache-2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `commons-io.commons-io-2.12.0`.


'commons-logging', licensed under the The Apache Software License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `commons-logging.commons-logging-1.2`.


'izumi-reflect-thirdparty-boopickle-shaded_2.13', licensed under the Apache-2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `dev.zio.izumi-reflect-thirdparty-boopickle-shaded_2.13-2.3.8`.
Expand Down Expand Up @@ -456,21 +416,6 @@ The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `org.apache.commons.commons-lang3-3.12.0`.


'commons-text', licensed under the Apache License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `org.apache.commons.commons-text-1.10.0`.


'httpclient', licensed under the Apache License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `org.apache.httpcomponents.httpclient-4.4.1`.


'httpcore', licensed under the Apache License, Version 2.0, is distributed with the engine.
The license information can be found along with the copyright notices.
Copyright notices related to this dependency can be found in the directory `org.apache.httpcomponents.httpcore-4.4.1`.


'tika-core', licensed under the Apache License, Version 2.0, is distributed with the engine.
The license file can be found at `licenses/APACHE2.0`.
Copyright notices related to this dependency can be found in the directory `org.apache.tika.tika-core-2.4.1`.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d6d3709

Please sign in to comment.