perf: improve memory usage for static vnodes
Use the already mounted nodes as cache instead of separate caching via template. This reduces memory usage by 30%+ in VitePress.
This commit is contained in:
@@ -124,7 +124,9 @@ export interface RendererOptions<
|
||||
content: string,
|
||||
parent: HostElement,
|
||||
anchor: HostNode | null,
|
||||
isSVG: boolean
|
||||
isSVG: boolean,
|
||||
start?: HostNode | null,
|
||||
end?: HostNode | null
|
||||
): [HostNode, HostNode]
|
||||
}
|
||||
|
||||
@@ -511,7 +513,9 @@ function baseCreateRenderer(
|
||||
n2.children as string,
|
||||
container,
|
||||
anchor,
|
||||
isSVG
|
||||
isSVG,
|
||||
n2.el,
|
||||
n2.anchor
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user