ocurrent / citty

CI in tty
MIT License
15 stars 7 forks source link

Fix tracing #13

Closed let-def closed 4 years ago

let-def commented 4 years ago

The Lwd abstraction tracks dependencies between different parts of the UI, implementing a primitive form of reactive programming. The current code suffers from two problems: 1) A limitation: reverse dependency tracking is linear w.r.t the number of dependencies of a node. The performance could possibly degenerate to O(n^2) when there is a large number of dependencies. This can occur in typical UI code, but should be rare... The maximum number of dependencies in Citty is ~3. 2) A bug: some dependencies are not cleaned, leading to a space leak and degenerate performances (proportional to the size of history).

This branch implements a new reverse dependency tracking algorithm with two code-paths:

I don't really expect anyone to review this PR, the purpose is rather to keep track of my developments around that problem. (But if someone feels like it, I will be happy to help reviewing)