Skip to content

Commit 433cc43

Browse files
perf: Avoid duplicate dirty parent elements to improve performance by 2% (#1968)
* perf: 避免重复dirty父级元素提升2%性能 * perf: accept gemini review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * refactor: 修复eslint --------- Co-authored-by: huiyu.zjt <huiyu.zjt@antgroup.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent d4923a8 commit 433cc43

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/g-lite/src/services/SceneGraphService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,13 @@ export class DefaultSceneGraphService implements SceneGraphService {
938938
element.ownerDocument?.defaultView?.getConfig()?.future
939939
?.experimentalAttributeUpdateOptimization === true;
940940

941-
while (p) {
941+
while (
942+
p &&
943+
!(
944+
(p as Element).renderable?.dirty &&
945+
(p as Element).renderable?.boundsDirty
946+
)
947+
) {
942948
(p as Element).dirty?.(true, true);
943949

944950
if (enableAttributeUpdateOptimization) {

0 commit comments

Comments
 (0)