You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modifying the renderHtml function (and likewise renderSvg) could greatly improve the performance of Hypertext Literal when rendering the same template over and over again. Something like:
When should the cache be cleared (e.g., after a requestAnimationFrame or Promise.resolve())? Should caching be optional or configurable? Should the size of the cache be? Should the cache be scoped to individual literals using a WeakMap?
Hypertext Literal may currently inline interpolated values into the generated HTML to avoid needing to walk the tree and substitute dynamic values into placeholders (e.g., comments). However when caching, it might be desirable to always use placeholders, so that the generated template is never dependent on the interpolated values and can be shared.
I’d also love realistic benchmarks that we can use to measure these potential performance improvements.
The text was updated successfully, but these errors were encountered:
Modifying the renderHtml function (and likewise renderSvg) could greatly improve the performance of Hypertext Literal when rendering the same template over and over again. Something like:
But, open questions:
When should the cache be cleared (e.g., after a requestAnimationFrame or Promise.resolve())? Should caching be optional or configurable? Should the size of the cache be? Should the cache be scoped to individual literals using a WeakMap?
Hypertext Literal may currently inline interpolated values into the generated HTML to avoid needing to walk the tree and substitute dynamic values into placeholders (e.g., comments). However when caching, it might be desirable to always use placeholders, so that the generated template is never dependent on the interpolated values and can be shared.
I’d also love realistic benchmarks that we can use to measure these potential performance improvements.
The text was updated successfully, but these errors were encountered: