Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Vue Reactive vs Ref vs ShallowRef. Arrays
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 16; Mobile; rv:140.0) Gecko/140.0 Firefox/140.0
Browser:
Firefox Mobile 140
Operating system:
Android
Device Platform:
Mobile
Date tested:
10 months ago
Test name
Executions per second
Reactive
4829.5 Ops/sec
Ref
4723.9 Ops/sec
ShallowRef
16893.5 Ops/sec
HTML Preparation code:
<script src="https://unpkg.com/vue@3"></script>
Tests:
Reactive
const {reactive, computed} = Vue; const dataTest = new Array(1000).fill(0).map((el, index) => ({id: index, name: `${index}`})) const v = reactive({ foo: dataTest }); const bar = v.foo; const frog = computed(()=>{ return [...v.foo, {id: -1, name: '-1', }]; }); v.foo = new Array(1000).fill(0).map((el, index) => ({id: index + 1, name: `${index + 1}`}))
Ref
const {ref, computed} = Vue; const dataTest = new Array(1000).fill(0).map((el, index) => ({id: index, name: `${index}`})) const foo = ref(dataTest); const bar = foo.value; const frog = computed(()=>{ return [...v.foo, {id: -1, name: '-1', }]; }); foo.value = new Array(1000).fill(0).map((el, index) => ({id: index + 1, name: `${index + 1}`}))
ShallowRef
const {shallowRef, computed} = Vue; const dataTest = new Array(1000).fill(0).map((el, index) => ({id: index, name: `${index}`})) const foo = shallowRef(dataTest); const bar = foo.value; const frog = computed(()=>{ return [...v.foo, {id: -1, name: '-1', }]; }); foo.value = new Array(1000).fill(0).map((el, index) => ({id: index + 1, name: `${index + 1}`}))