dillon1000/react

Commit

Option to disable memoization

Adds a `removeAllMemoization` flag that runs the entire compiler pipeline but 
strips out all memoization. The intent is to be able to compare (in limited 
use-cases) the performance of an existing app with all memoization removed, vs 
the performance with manual memoization, vs the performance with Forget enabled. 

In terms of how this works: we already strip out useMemo/useCallback since 
Forget is more accurate. The new option adds an extra pass that strips out all 
reactive scopes. Collectively this leaves ~zero memoization within components 
(this does leave React.memo, but close enough).
Browse files
Changed paths7 files
First-parent comparison
M compiler/forget/packages/snap/src/compiler-worker.ts ModifiedM compiler/forget/src/CompilerPipeline.ts ModifiedM compiler/forget/src/HIR/Environment.ts ModifiedA compiler/forget/src/ReactiveScopes/PruneAllReactiveScopes.ts AddedM compiler/forget/src/ReactiveScopes/index.ts ModifiedA compiler/forget/src/__tests__/fixtures/compiler/remove-memoization-kitchen-sink.expect.md AddedA compiler/forget/src/__tests__/fixtures/compiler/remove-memoization-kitchen-sink.js Added
Patch

Files changed

Rendering syntax-highlighted changes…