You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
constn0=_createFor(()=>source1,ctx0=>{// ^ ShallowReactiveconstn1=t0()on(element,()=>ctx0[1])// ^ otherrenderEffect(()=>setText(n2,ctx0[0]+ctx0[1]+ctx0[2]))// ^ id ^ other ^ index// Nested v-forconstn2=_createFor(()=>source2,ctx1=>{console.log(ctx0[0],ctx1[0])// ^ id ^ item of source2},)insert(n2,n1)returnn1},// Get item key with destructuring assignment({ id, ...other},index)=>(id),null,null,false,// Destructuring assignmentstate=>{// ^ state === block.stateconst[{ id, ...other},index]=_statereturn[id,other,index]},)
Benchmark
Benchmark
main hash: 1008199647224ba793b6c3a596483e1ed69df946
The current Playground in the Vapor project uses a list of shallowRef in bench/App.vue to measure the performance of v-for. When updating something, it directly refreshes the entire list with rows.value = rows.value.slice(). It seems like this is a kind of negative optimization when measuring projects like "Update every 10th row"?
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.
related #204 closes #220
TODO
Playground
TODO List Demo
Runtime Code
Benchmark
Benchmark
main hash:
1008199647224ba793b6c3a596483e1ed69df946
Benchmark mounting
in branch main
shallowRef source:
runLots: min: 349.90 / max: 543.30 / median: 467.90ms / mean: 431.01ms / time: 495.70ms / std: 72.04 over 30 runs
ref source:
runLots: min: 354.10 / max: 614.70 / median: 400.10ms / mean: 440.34ms / time: 400.10ms / std: 91.12 over 30 runs
in this PR
shallowRef source:
runLots: min: 358.10 / max: 604.20 / median: 381.00ms / mean: 388.91ms / time: 381.90ms / std: 43.88 over 30 runs
ref source:
runLots: min: 365.40 / max: 581.70 / median: 387.00ms / mean: 419.89ms / time: 444.60ms / std: 55.14 over 30 runs
Update every 10th row (10,000 rows)
in branch main
shallowRef source:
update: min: 133.10 / max: 356.70 / median: 150.00ms / mean: 166.53ms / time: 319.40ms / std: 47.89 over 30 runs
ref source:
update: min: 133.20 / max: 529.40 / median: 150.20ms / mean: 174.48ms / time: 166.80ms / std: 76.70 over 30 runs
in this PR
update: min: 144.90 / max: 291.90 / median: 159.90ms / mean: 164.11ms / time: 159.90ms / std: 27.89 over 30 runs
update: min: 132.60 / max: 294.60 / median: 150.00ms / mean: 163.70ms / time: 150.00ms / std: 45.18 over 30 runs