Mai Huy HoàngandClaude Opus 5 b4a4b8d827 [2.x] perf: Intern the values an UpdateReport is built of
The projects of a build mostly depend on the same libraries, and each project's
report materializes its own copies of every coordinate it names, so one value
exists once per project that mentions it: on a 302-module monorepo the cached
reports hold 949,492 ModuleReports for 2,036 distinct values.

UpdateReportInterner adds weak pools for ConfigRef, InclExclRule, File,
Artifact, ModuleID, Caller and ModuleReport itself. Pooling the report is worth
more than pooling its parts alone, because sharing it also shares its licenses
vector, extraAttributes map, homepage string and artifacts vector. Reports
carrying a publicationDate are canonicalized but never pooled, since that
java.util.Calendar is mutable; everything else reachable from a ModuleReport is
immutable, so sharing is semantically invisible.

The pools are weak, so a value lives exactly as long as some report references
it and nothing accumulates across a reload.

Two sites cover a freshly resolved report. SbtUpdateReport interns each report
as it builds it rather than sweeping the finished one, so only the module under
construction is ever un-interned. That alone would not survive, though:
coursier memoizes moduleReport on a key that includes the dependees, so each
project builds its own instance of a shared coordinate, and transformDetails
then rebuilt every report to drop the callers -- discarding the sharing and
leaving a copy per module per configuration. Dropping the callers is what makes
those reports value-equal in the first place, so transformDetails now re-interns
what it rebuilds, and only rebuilds when there is something to drop. A scripted
test pins it: two projects resolving one coordinate must end up holding one
ModuleReport instance, on the fresh path and from the cache.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-07-29 09:43:09 +07:00
2026-07-06 20:07:30 +09:00
2026-07-27 00:02:28 -04:00
2026-05-31 16:01:15 -04:00
2026-05-31 16:01:15 -04:00
2026-05-31 16:01:15 -04:00
2026-07-25 23:27:49 -04:00
2026-07-26 14:45:03 -04:00
2026-01-24 04:52:28 -05:00
2023-11-25 01:06:30 -05:00
2019-06-11 09:30:14 +02:00
2020-11-19 12:42:26 -08:00
2023-01-02 22:06:46 -05:00
2023-06-20 16:39:07 +02:00
2023-06-20 16:39:07 +02:00
2026-07-26 00:57:19 -04:00
2021-04-19 23:43:15 -04:00
2017-10-03 01:45:06 -04:00
2023-06-20 16:39:07 +02:00

CI Latest version Discord

sbt

sbt is a build tool for Scala, Java, and more.

For general documentation, see https://www.scala-sbt.org/.

sbt 2.x

This is the 2.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.

  • sbt/io hosts sbt.io module.
  • sbt/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implement the build tool.
  • Setup: Describes getting started with the latest binary release.
  • FAQ: Explains how to get help and more.
  • sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions

Issues and Pull Requests

Please read CONTRIBUTING carefully before opening a GitHub Issue or a pull request.

If you're looking for an idea for a contribution, issues labeled with good first issue or help wanted might be good starting points.

If you would like to ask questions about sbt, there's sbt channel on Scala Discord, but it would be good to gather questions on Stackoverflow.

license

See LICENSE.

S
Description
sbt, the interactive build tool
Readme
97 MiB
Languages
Scala 94.5%
Java 3.1%
Shell 1.1%
Batchfile 0.9%
Roff 0.2%
Other 0.1%