Skip to content

Commit dd226fe

Browse files
authored
Improve mustachio deduplication strategy (#3906)
Currently mustachio has a very rudimentary deduplication strategy that leaves a fair number of unused partial render functions dangling in the generated code. This is because we delete a partial renderer function without taking great care about what partial functions it might have rendered, and which maybe are no longer rendered. This occurs particularly with deduplicated renderer functions that then don't become used any more. This change introduces a renderer cache and a more formal 'reference-counting' strategy to know if a renderer becomes unused. Tracking all renderer functions (and the compilers that compiled them, and the used context stacks determined by compilers) in one place makes it possible to have a more accurate understanding of what renderer functions become unused through the deduplication process. The new strategy is documented pretty well in this change, in the README.
1 parent 7e503c1 commit dd226fe

6 files changed

+2127
-2885
lines changed

0 commit comments

Comments
 (0)