Reimplement escape analysis for keyed in new FlatAST
- Dominant language
- Elixir
- Stars
- 119
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
If we know the set of variables captured by a `keyed`, we can be smarter about when it is reevaluated.
As an example:
```elixir
deft render(assigns) do
for post <- assigns.posts do
keyed post.id do
%{
id: post.id,
name: post.name,
}
end
end
end
```
If we know that the `keyed post.id` block only uses state from within `post`, and we know `post` has not changed since the last render, we can omit rendering that subtree entirely.
This is a simple example, so omitting rendering the subtree would not give us much here, but when scaled to deeper and more complicated data structures, being able to omit rendering subtrees like this could be a major advantage.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.