4 ms·
This is a great usecase for diff tracking. 1) Store all actions by a user as as an array of add/remove commands (where a change is remove+add). 2) Whenever yo
by Vanit 4y ago
This is a great usecase for diff tracking.
1) Store all actions by a user as as an array of add/remove commands (where a change is remove+add).
2) Whenever you need to re-render take the cached version from the last render and perform the new add/remove commands that happened since the last render.
3) Cache the result for the next render and repeat.
- laurmaedje 4y agoIf I understand correctly, you mean manually writing code that patches the result of an action to the last output. That seems like a great approach for a simple transformation pipeline. For a full compiler it seems harder to pull off. That's the great thing about memorization: It more or less let's you write the compiler like you would have done without it.