HaxeFoundation / HaxeFoundation/haxe

[ide/cache] signature-based module invalidation

Open
#9,995 1 comment 0 reactions 0 assignees View on GitHub
enhancement feature-compiler-cache feature-ide
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Creating this issue to write down an idea for possible significant performance improvements for the cache server (and as a consequence - IDE performance).

---

The problem:

Currently if module A uses module B and we change module B in *any* way - module A will invalidate, causing its dependants to invalidate as well and so on. As a result there is a lot of potentially redundant re-typing happening on every change, which especially hurts IDE performance a lot.

---

The idea:

We can NOT invalidate module A if module B has changed but it's _signature_ stayed the same, where _signature_ is: defined public types, field names and types.

So if you change something at expression level and that doesn't affect the API of the module - we don't invalidate dependants.

---

Notes:

There are potential problems with inlining, but we can be conservative for a start and use the "full" dependency if we inline something from a module and figure out something better later.

Detecting the signature changes might require re-typing the changed module (especially if monomorphs are involved in field types), but it's what we already do anyway and it's still better to re-type one module, detect that its signature hasn't changed and not invalidate its dependants than to always invalidate and re-type like we do now.

---

Some extra thoughts by @Simn:

>11:50
I think as a first step we have to model dependents as (module * whatever)
11:51
There's probably three levels: 1. nothing changed 2. signature changed 3. everything changed

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.