scalacenter/scalac-profiling
60.7
Adequate · 20 September 2026
2.2k
lines of production code
Scala
with JavaScript
1
measurement over time
What this system is
This system is a set of Scala compiler plugins and an associated sbt plugin designed to profile and optimize the performance of the Scala 2 compiler. It instruments the compiler to collect detailed metrics on implicit searches and macro expansions, storing this data in a structured Protocol Buffer format for analysis. The tooling supports generating flamegraph visualizations to identify performance bottlenecks and includes an sbt integration to warm up the compiler and track task durations. It is built to support multiple versions of Scala 2.12 and 2.13.
How it got here
2017 — compiler profiling plugin development
13 changes.
This period focused on building the core infrastructure for a new Scala compiler profiling plugin, including the ProfileDB schema for storing metrics and the sbt integration for warmup and timing. Significant effort was also dedicated to restructuring the build system, updating dependencies, and expanding project documentation to support the new features.
2018–2023 — Website launch and CLI integration
8 changes.
This period focused on establishing the project's public presence by building a Docusaurus-based documentation website with initial pages, styling, and interactive assets. Concurrently, the codebase expanded its functionality by adding command-line argument parsing via case-app and implementing Scala version detection utilities to support cross-compilation and plugin configuration.
2024 — Scala version support expansion
4 changes.
The project expanded its compatibility by adding dedicated support for Scala versions 2.12.19, 2.13.15, 2.13.17, and 2.13.18. This involved implementing version-specific SettingsOps utilities to correctly query compiler statistics settings. Additionally, FlameGraph tooling was integrated as a Git submodule to support profiling workflows.
Features
Add English homepage skeleton for the website
A new React-based homepage component has been added for the English version of the site. This page displays a hero section with a call-to-action button linking to the user guide, followed by a features section highlighting capabilities such as speeding up Scala 2 compilation and optimizing macros.
website/pages · high confidence
Add Scala version detection utilities for the plugin
The plugin now includes version-specific helper objects (ScalaSettingsOps) for Scala 2.12 and 2.13 that expose boolean flags to identify the current Scala version at runtime, enabling conditional logic based on the compiler version.
plugin/src/main/scala-2.12, plugin/src/main/scala-2.13 · high confidence
Added AbsolutePath and RelativePath utility classes
New \AbsolutePath\ and \RelativePath\ value classes have been added to the \profiledb\ utilities package to provide structured handling of file system paths. These classes wrap Java NIO \Path\ objects, offering methods for resolving relative paths against a base directory, converting between absolute and relative representations, and performing basic file operations like checking if a path is a file or directory. This introduces a dedicated abstraction for path manipulation within the profiledb module, replacing or supplementing direct usage of raw path strings or Java NIO classes in this location.
profiledb/src/main/scala/ch.epfl.scala.profiledb/utils · high confidence
Added command-line argument parsing integration for case-app
The integrations module now includes a new Parsers.scala file that sets up argument parsing for the case-app library. This adds support for parsing standard input/output streams, file paths, and various default options (strings, integers, booleans) for CLI commands such as compile, run, test, and clean. A placeholder Main object is also included.
integrations · high confidence
Initial sbt build infrastructure with integration test support
The project now includes a new sbt build structure (BuildPlugin.scala) that configures the build tool version to 1.13.0 and sets up integration tests for external libraries like better-files and wartremover. This change introduces a custom plugin cross-building command (WorkingPluginCross.scala) to manage Scala version switching during compilation and adds specific build settings for publishing and developer metadata.
project · high confidence
Initial website skeleton and configuration for scalac-profiling
The website now includes a foundational structure for the scalac-profiling documentation site, powered by Docusaurus. A new site configuration (siteConfig.js) defines the project identity, branding colors, Algolia search credentials, and navigation links pointing to the GitHub repository. Additionally, a sidebar definition (sidebars.json) establishes the initial documentation hierarchy, organizing content into 'Usage' (covering motivation, installation, and usage) and 'Plugins' (specifically the sbt-plugin).
website · high confidence
Initial website skeleton with Footer and GridBlock components
This change introduces the foundational UI components for the project's documentation website. It adds a Footer component that displays site branding, navigation links to installation and usage guides, community chat links (Discord and Scala Users), and GitHub repository access. It also adds a GridBlock component, which renders structured content blocks with configurable layouts (two, three, or four columns) and supports image alignment (left, right, top, bottom) alongside markdown content, enabling the creation of feature-rich landing page sections.
website/core · high confidence
Initial website styling and documentation assets
The website now includes a custom CSS stylesheet that defines layout rules for headers, images, and content containers, along with responsive adjustments for mobile and large-screen devices. Additionally, an interactive flame graph visualization for Scala Steward implicit searches has been added to the static assets, providing users with a tool to explore performance data directly in the browser.
website/static · high confidence
Introduce ProfileDB schema for structured compiler profiling data
A new protobuf schema (profiledb.proto) defines the data model for storing compiler performance metrics. This schema structures data into global or per-compilation-unit profiles, capturing run phases with timers and counters, as well as detailed metrics for macro expansions and implicit searches including positions, durations, and search counts.
profiledb/src/main/protobuf · high confidence
Introduce ProfileDb for structured profile storage and path validation
This change introduces the core \ProfileDb\ component, which provides methods to read and write profile data to disk using Protocol Buffers, ensuring files are properly closed after I/O operations. It also adds \ProfileDbPath\ to manage file locations, enforcing validation rules such as requiring the \.profiledb\ extension and a specific \META-INF/profiledb\ prefix, while providing utilities to resolve paths for global and graphs profiles.
profiledb/src/main/scala/ch.epfl.scala.profiledb · high confidence
Introduce Scalac profiling plugin for performance analysis
Adds a new \scalac-profiling\ compiler plugin that instruments the Scala compiler to track performance metrics for implicit searches and macro expansions. Users can enable features such as generating global or macro-specific flamegraphs, logging detailed profile information per call-site, and printing failed implicit search candidates via specific compiler options (e.g., \-P:scalac-profiling:generate-global-flamegraph\). The plugin supports cross-compilation for Scala 2.12 and 2.13 and writes profiling data to configurable target directories.
plugin/src/main/scala/ch/epfl/scala · high confidence
Introduce sbt-scalac-profiling plugin for compiler warmup and timing
Adds the \ProfilingSbtPlugin\ and \SbtTaskTimer\ to the \sbt-plugin/src/main\ directory, enabling users to warm up the Scala compiler before builds and track compilation task durations. The plugin exposes \profilingWarmupDuration\ and \profilingWarmupCompiler\ settings, using a command-based warmup loop that deletes class files to prevent incremental compilation interference, while the timer aggregates execution times per task key using classloader-scoped data.
sbt-plugin/src/main · high confidence
New documentation generation and CLI integration infrastructure
The tooling now includes a new \docs-gen\ module that resolves project dependencies via Coursier and fetches the latest release versions from Sonatype, alongside a new \integrations\ module that defines the command-line interface structure using CaseApp. On the compiler plugin side, the profiling implementation has been expanded to track implicit search data (including per-type and per-file metrics) and generate flamegraph visualizations for both macro expansions and implicit searches, supported by new configuration options and debug info models.
repository · high confidence
Behavioural changes
Add Scala 2.13.17 support
The plugin now includes a dedicated source directory for Scala 2.13.17, containing a new SettingsOps utility that exposes the compiler's statistics-enabled setting, enabling the profiler to correctly query and respect statistics configuration for this specific Scala version.
(repo-wide) · high confidence
Added Scala 2.12.18-specific settings helper
A new \SettingsOps\ helper object was added to the Scala 2.12.18 plugin source directory to expose the \areStatisticsEnabled\ setting from the Scala compiler global, enabling the profiler to check if statistics collection is active for this specific compiler version.
plugin/src/main/scala-2.12.18, plugin/src/main/scala-2.13.14 · high confidence
Added Scala 2.13.15-specific settings operations
A new \SettingsOps\ utility has been added for the Scala 2.13.15 compiler version to expose the \areStatisticsEnabled\ setting, enabling the profiler to check if compiler statistics are active for this specific Scala release.
plugin/src/main/scala-2.13.15, plugin/src/main/scala-2.13.18 · high confidence
Automated documentation generation with dynamic Scala version lists
The documentation build process now automatically generates site variables for supported Scala 2.12 and 2.13 versions, sorting them in descending order to display the most recent versions first. This change introduces a new entry point in the docs-gen module that prepares these version lists and passes them to mdoc, ensuring the generated documentation always reflects the current set of cross-compiled Scala versions without manual updates.
docs-gen · high confidence
Refactor profiler internals with new logging and robust quantity access
The profiler plugin introduces a new Logger utility for structured debug and info output and replaces the previous method of accessing compiler statistics with a QuantitiesHijacker that safely retrieves registered quantities by falling back to method invocation if field access fails. These changes improve the reliability of internal data collection and provide better visibility into profiler operations.
plugin/src/main/scala/ch/epfl/scala/profilers · high confidence
Repository configuration and documentation overhaul
The repository has been restructured with new configuration files and documentation to improve developer experience and project clarity. A \.gitignore\ file was added to exclude build artifacts, IDE settings, and generated files. The \.scalafmt.conf\ was updated to version 3.11.5 with stricter formatting rules, including preserved trailing commas and specific docstring styles. A \.jvmopts\ file was introduced to set JVM memory and code cache limits for consistent builds. Documentation was significantly expanded: a new \HISTORICALCONTEXT.md\ details the project's origins and goals, \PROPOSAL.md\ outlines the original performance profiling proposal, and \IDEAS.md\ lists future optimization concepts. The \README.md\ was updated with installation instructions, maintenance status, and links to external resources. Additionally, a \.git-blame-ignore-revs\ file was created to ignore formatting commits, and a \.gitmodules\ file was added to include the FlameGraph submodule.
(repo-wide) · high confidence
Fixes
Add Scala 2.12.19-specific SettingsOps utility
A new SettingsOps object has been added for the Scala 2.12.19 plugin variant, providing a helper method to check if statistics are enabled via the compiler's global settings.
plugin/src/main/scala-2.12.19 · high confidence
Test coverage
Added HList-based test case for compiler profiling warmup; Added sbt integration tests for compiler warmup profiling; Added test infrastructure and implicit resolution tests.
Dependencies
Added FlameGraph submodule
The project now includes the FlameGraph tooling as a Git submodule (commit 85f58b8), making it available for use within the external directory.
external · high confidence
Upgrade build infrastructure and update dependencies
The build system has been significantly restructured and updated. Sbt plugins are upgraded, including sbt-assembly to 2.4.1, sbt-ci-release to 1.12.1, sbt-scalafmt to 2.6.2, sbt-mdoc to 2.9.1, sbt-buildinfo to 0.13.1, sbt-git to 2.2.0, sbt-protoc to 1.0.8, and sbt-ghpages to 0.10.0. The project now supports Scala 2.12.18-2.12.21 and 2.13.14-2.13.18, dropping older versions. Test dependencies are updated to JUnit 4.13.2 and junit-interface 0.13.3. The build also introduces a new profiledb module and updates the main plugin to use pprint 0.9.0 and ScalaPB compilerplugin 0.11.17. Additionally, a new website module using Docusaurus 1.14.7 is added.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 61.
Lenses
- Code Health 98
- Architecture 83
- Maturity 48
- Readiness 59
- Security 81
Changes since last survey
- 300 commits — 281 feature/other, 19 fixes
By area
- (repo) — 138 commits
- project/build.sbt — 49 commits
- (root) — 43 commits
- .github/workflows — 23 commits
- project/build.properties — 22 commits
- plugin/src — 10 commits
- .github/labeler.yml — 5 commits
- docs/user-guide — 3 commits
- website/siteConfig.js — 2 commits
- bin/clean-cache.sh — 1 commit
- docs-gen/src — 1 commit
- integrations/src — 1 commit
- project/BuildPlugin.scala — 1 commit
- website/static — 1 commit
Notable commits
- fix: Fix closing img tags in docs
- fix: Fix deprecation in build.sbt
- fix: Fix scalac-profiling github repo link in usage.md
- fix: Fix several deprecations in BuildPlugin
- fix: Fix the directory of SettingsOps for Scala 2.12.19
- fix: Fix the underlying folder with website artefacts in CI workflow
- fix: Merge branch 'main' into fix-#44
- fix: Merge pull request #100 from danicheg/fix-labelling
- fix: Merge pull request #102 from danicheg/fix-labelling-once-again
- fix: Merge pull request #103 from danicheg/fix-labelling-once-again
- fix: Merge pull request #161 from danicheg/fix-publish-workflow
- fix: Merge pull request #162 from danicheg/fix-publish-website-workflow
- fix: Merge pull request #195 from SakulK/fix-scalac-profiling-link-in-usage-md
- fix: Merge pull request #49 from danicheg/fix-#44
- fix: Merge pull request #88 from danicheg/fix-html
- fix: Merge pull request #90 from danicheg/fix-img-compression-on-site
- fix: Merge pull request #91 from danicheg/fix-img-compression-on-site
- fix: Merge pull request #93 from danicheg/fix-website-publishing
- fix: Merge pull request #94 from danicheg/hot-fix
- change: Add 'Reformat with scalafmt 3.11.2' to .git-blame-ignore-revs
- …and 280 more
Architecture
- 0 containers · 2 bounded contexts · 1 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
scalacenter/scalac-profiling was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 01df624e2e98543e30dfd738b4e1c2db69584922 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.