Skip to content
New issue

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

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

Already on GitHub? # to your account

perf(runtime-core): use for of to replace for loop #12024

Closed
wants to merge 1 commit into from

Conversation

chenfan0
Copy link
Contributor

In reviewing PR #9511, I noticed that the renderList function uses a regular for loop instead of a for...of loop. Using a regular for loop reads each item in the source array, which results in tracking each item of the source array. However, using a for...of loop does not read each item in the array.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (-64 B) 38 kB (-30 B) 34.2 kB (-13 B)
vue.global.prod.js 160 kB (-64 B) 57.9 kB (-32 B) 51.5 kB (-19 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 49 kB 18.9 kB 17.2 kB
createApp 55.6 kB 21.4 kB 19.6 kB
createSSRApp 59.6 kB 23.1 kB 21 kB
defineCustomElement 60.4 kB 22.9 kB 20.9 kB
overall 69.3 kB 26.5 kB 24 kB

Copy link

pkg-pr-new bot commented Sep 25, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@12024

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@12024

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@12024

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@12024

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@12024

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@12024

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@12024

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@12024

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@12024

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@12024

vue

pnpm add https://pkg.pr.new/vue@12024

commit: 3bc58c5

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants