ValdemarGr / mezel

Scala BSP implementation for Bazel.
Apache License 2.0
17 stars 2 forks source link

Optimizations #1

Closed ValdemarGr closed 11 months ago

ValdemarGr commented 11 months ago

Right now compile, compiles everything, which allows propagation of errors. However it is possible to have this and also a bit more performance.

When a build completes the entire set of diagnostics files are read from the filesystem.

  1. If we could infer the set of transitive compile targets a target implies we can narrow down the diagnostics files to read.
  2. We can rebuild only the selected targets in the foreground and read the selected targets' diagnostics files, then we can, in the background, rebuild everything and read the changed diagnostics files (1).

We can either use bazel query somepath or a Scala computation to construct the ancestors set for our targets.

If we can ask bazel about cache invalidation things, maybe we can cache diagnostics locations also?

buildTargets, scalacOptions sources and dependencySources are fairly rare, so a full filesystem read is okay I think.

ValdemarGr commented 11 months ago

Build event protocol (bazel) to stream diagnostics to the caller