Commit 3aad31b
committed
perf: cache empty VList Rc in VNode::default to avoid repeated heap allocation
VNode::default() is called on every mem::take() during reconciliation.
Previously each call heap-allocated a new Rc<VList>. Use a thread_local
to cache a single Rc<VList> and reuse it via Rc::clone (refcount bump only).1 parent 3cbf219 commit 3aad31b
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
0 commit comments