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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser:
Chrome 141
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Reactive
34676.7 Ops/sec
Ref
37048.9 Ops/sec
ShallowRef
125631.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}`}))