-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
refactor(defaults): improve component performance #16775
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
johnleider
added
T: enhancement
Functionality that enhances existing features
framework
Issues and Feature Requests that have needs framework-wide.
labels
Feb 24, 2023
johnleider
force-pushed
the
refactor/component-perf-tuning
branch
from
February 24, 2023 21:24
0e50478
to
f028da5
Compare
KaelWD
previously requested changes
Feb 27, 2023
packages/vuetify/src/components/VDefaultsProvider/VDefaultsProvider.tsx
Outdated
Show resolved
Hide resolved
johnleider
force-pushed
the
refactor/component-perf-tuning
branch
from
February 27, 2023 19:04
1427396
to
48f7743
Compare
gkubisa
reviewed
Feb 28, 2023
packages/vuetify/src/components/VDefaultsProvider/VDefaultsProvider.tsx
Outdated
Show resolved
Hide resolved
recommend incognito window or clean browser profile with no extensions installed <template>
<v-app>
<v-container>
<template v-for="i in length">
<v-btn />
</template>
</v-container>
</v-app>
</template>
<script setup>
import { nextTick, onMounted, ref } from 'vue'
const ITEMS = 1000
const COUNT = 20
const WARMUP_COUNT = 5
const DELAY = 200
const length = ref(0)
function wait (ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
onMounted(async () => {
await wait(500)
for (let i = 0; i < WARMUP_COUNT; i++) {
length.value = ITEMS
await nextTick()
length.value = 0
await nextTick()
}
requestIdleCallback(async () => {
const result = []
await wait(DELAY)
for (let i = 0; i < COUNT; i++) {
length.value = ITEMS
const start = performance.now()
await nextTick()
result.push(performance.now() - start)
await wait(DELAY)
length.value = 0
await nextTick()
await wait(DELAY)
}
const avg = Math.round(result.reduce((a, b) => a + b, 0) / result.length)
const sd = Math.round(Math.sqrt(result.reduce((a, b) => a + b * b, 0) / result.length - avg * avg))
console.log(result.map(v => Math.round(v)).join('\n'))
console.log('avg', `${avg}ms ±${sd}`)
})
})
</script>
|
this fix showed no discernible perf issues / changes
johnleider
force-pushed
the
refactor/component-perf-tuning
branch
from
March 7, 2023 17:42
4ab2841
to
74fb414
Compare
johnleider
force-pushed
the
refactor/component-perf-tuning
branch
from
March 7, 2023 17:45
74fb414
to
c003e6a
Compare
KaelWD
reviewed
Mar 8, 2023
KaelWD
reviewed
Mar 8, 2023
KaelWD
reviewed
Mar 8, 2023
johnleider
force-pushed
the
refactor/component-perf-tuning
branch
from
March 14, 2023 22:19
83866b0
to
e06c84f
Compare
johnleider
changed the title
refactor: improve component performance
refactor(defaults): improve component performance
Mar 14, 2023
johnleider
added a commit
that referenced
this pull request
Mar 15, 2023
fixes #16920 this is a temporary fix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
framework
Issues and Feature Requests that have needs framework-wide.
T: enhancement
Functionality that enhances existing features
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Improve framework performance