hansihe / hansihe/live_data

Reimplement escape analysis for keyed in new FlatAST

Open
#12 3 comments 0 reactions 0 assignees View on GitHub
short term
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.