Lively Kernel canvas
//
BenchmarkLocalStorage40
DragtoresizethisobjectAlt+dragtorotatetheobjectAlt+shift+dragtoscaletheobjectShift+dragtochangeborderwidth3
false
10002.097159879234875Wikicontroltrue
=BenchmarkLocalStorageResults=setcounter4msgetandsetcounter5msappendcountern=100014msappendcountern=200040msappendcountern=300072msappendcountern=4000202msappendcountern=6000522msappendcountern=8000897msunserialize,append,andserializecounter(n=100)10msunserialize,append,andserializecounter(n=200)32msunserialize,append,andserializecounter(n=300)64msunserialize,append,andserializecounter(n=400)107msunserialize,append,andserializecounter(n=600)294msunserialize,append,andserializecounter(n=800)536ms
nulltrue14truetruefalse100truetrue
false00.11truefalsetruetrue
nullfalsetruenull
falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
$morph('resultText').setTextString('=BenchmarkLocalStorageResults=')$morph('resultText').tabWidth=100addResult=function(s){varm=$morph('resultText')m.setTextString(m.textString+'\n'+s)}n=1000;addResult('setcounter'+Functions.timeToRun(function(){for(vari=0;i<n;i++){localStorage.setItem("mycounter",i)}})+"ms")addResult('getandsetcounter'+Functions.timeToRun(function(){for(vari=0;i<n;i++){varold=localStorage.getItem("mycounter")localStorage.setItem("mycounter",i)}})+"ms")bench=function(n){localStorage.mycounter=""addResult('appendcountern='+n+''+Functions.timeToRun(function(){for(vari=0;i<n;i++){varold=localStorage.getItem("mycounter")localStorage.setItem("mycounter",old+","+i)}})+"ms")}bench(1000);bench(2000);bench(3000);bench(4000);bench(6000);bench(8000);bench=function(n){localStorage.mycounter=JSON.serialize([])addResult('unserialize,append,andserializecounter(n='+n+')'+Functions.timeToRun(function(){for(vari=0;i<n;i++){varold=JSON.unserialize(localStorage.getItem("mycounter"))old.push(i)localStorage.setItem("mycounter",JSON.serialize(old))}})+"ms")}bench(100);bench(200);bench(300);bench(400);bench(600);bench(800);18truetruefalsetruetrue
false00.11truefalsetruetrue
nullfalsetruenull
falsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
dismissallfalsenulltruefalsetrue
Xfalsenulltruefalsetrue
serializing....16nullnull72