Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(apiWatch): avoid unnecessary traverse #9953

Closed

Conversation

Alfred-Skyblue
Copy link
Member

In the modification at #9928, if the reactive parameter is passed, a traverse action will be performed regardless of the circumstances. However, when the user manually passes deep:true, it results in two traverse actions, leading to unnecessary execution of traverse.

if (cb && deep) {
const baseGetter = getter
getter = () => traverse(baseGetter())
}

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 89.5 kB (+5 B) 34 kB (+3 B) 30.7 kB (+52 B)
vue.global.prod.js 146 kB (+5 B) 53.3 kB (+4 B) 47.6 kB (-2 B)

Usages

Name Size Gzip Brotli
createApp 49.8 kB (+5 B) 19.5 kB (+2 B) 17.9 kB (+52 B)
createSSRApp 53.2 kB (+5 B) 20.8 kB (+2 B) 19 kB (+1 B)
defineCustomElement 52.1 kB (+5 B) 20.3 kB (+1 B) 18.5 kB (-9 B)
overall 63.3 kB (+5 B) 24.4 kB (+2 B) 22.2 kB (-25 B)

@yyx990803
Copy link
Member

Did the same in 24d77c2 - thanks!

@yyx990803 yyx990803 closed this Jan 3, 2024
@Alfred-Skyblue Alfred-Skyblue deleted the fix/watch-deep-traverse branch January 3, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants