Lively Kernel canvas
BenchmarkContextJSActiveLayers40true
uploadresultsfalsenullfalsetruenull
oldresultsfalsenullfalsetruenull
ContextJSBenchmarkDate:ThuOct07201016:04:31GMT+0200(CEST)Browser:Mozilla/5.0(Macintosh;U;IntelMacOSX10_6_4;en-us)AppleWebKit/533.18.1(KHTML,likeGecko)Version/5.0.2Safari/533.18.5Revision:30502nameopstimeops/timePLAINo.foo1()2048001481384Wrapo.foo1()640010362activeLayersPLAIN1280018171D+Gbutnoactivation1280018868D+G1globallayer640019134D+G2globallayer320033010D+G3globallayer320015920D+G4globallayer320019516D+G5globallayer160011114D+Gwith1layer320012126D+Gwith2layer160011314D+Gwith3layer16003914D+Gwith4layer8001426D+Gwith5layer8001695S+Inoactivation1280019466S+I1layer640017636S+I2layer320032710S+I3layer320015820S+I4layer320019317S+I5layer160011414S+Inolayer,1ownerdepth640017038S+Inolayer,2ownerdepth320032510S+Inolayer,3ownerdepth320015621S+Inolayer,4ownerdepth320016919S+Inolayer,5ownerdepth16003035S+Inolayerdef,5ownerdepth2048001161766S+I1layer,1ownerdepth320015720S+I2layer,2ownerdepth160014511S+I3layer,3ownerdepth8001117S+I4layer,4ownerdepth8003682S+I5layer,5ownerdepth4001124S+I+G+Dnolayer,noowner640017038S+I+G+D1layer,1ownerdepth160010815S+I+G+D1Slayer,1ownerdepth160010815S+I+G+D1S,1Glayer,1o.1600341540truetruefalse16truetruefalse
00.11
true
truetruefalse
nullfalsetruenullfalse
resultsfalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
Wikicontroltruetrue
Object.addMethods({activeLayers:function(){return[]}})CopBenchmark.MAXSIZE=1000000000CopBenchmark.TARGETTIME=100GlobalLayerActivations=[]LayerActivationStack=[]enableLayer=function(layer){if(GlobalLayerActivations.include(layer))return;else{GlobalLayerActivations.push(layer);};}disableLayer=function(layer){if(!GlobalLayerActivations.include(layer))return;else{GlobalLayerActivations=GlobalLayerActivations.reject(function(ea){returnea==layer;});}}composeLayers=functioncomposeLayers(activationStack,index){//1.GlobalLayerActivationsif(index<0){returnGlobalLayerActivations}varactivation=activationStack[index]varlayerComposition=composeLayers(activationStack,index-1)//2.DynamicLayerActivationsif(activation.withLayers){layerComposition=layerComposition.reject(function(ea){returnactivation.withLayers.include(ea)})returnlayerComposition.concat(activation.withLayers)}//3.DynamicLayerDeactivationsif(activation.withoutLayers){layerComposition=layerComposition.reject(function(ea){returnactivation.withoutLayers.include(ea)})returnlayerComposition}}//META:dotheybelongbeforeofafterthecompositioncodewithLayers=functionwithLayers(layers,func){LayerActivationStack.push({withLayers:layers});try{func()}finally{LayerActivationStack.pop()}}withoutLayers=functionwithoutLayers(layers,func){LayerActivationStack.push({withoutLayers:layers})try{func()}finally{LayerActivationStack.pop()}}Object.subclass('MyObject',{foo1:function(a){returna*a},foo2:function(a){returna*a},activeLayers:function(){returncomposeLayers(LayerActivationStack,LayerActivationStack.length-1)}})cop.create("MyLayer").refineClass(MyObject,{foo2:function(proceed,a){returnproceed(a)*a}})cop.create("MyLayer2").refineClass(MyObject,{foo2:function(proceed,a){returnproceed(a)*a}})cop.create("MyLayer3").refineClass(MyObject,{foo2:function(proceed,a){returnproceed(a)*a}})cop.create("MyLayer4").refineClass(MyObject,{foo2:function(proceed,a){returnproceed(a)*a}})cop.create("MyLayer5").refineClass(MyObject,{foo2:function(proceed,a){returnproceed(a)*a}})MyObject.subclass('MyStructuralObject',{initialize:function(owner){this.owner=owner},getWithLayers:function(){if(!this.withLayers)return[];returnthis.withLayers},setWithLayers:function(layers){this.withLayers=layers},structuralLayers:function(){varlayers=this.getWithLayers()if(this.owner){varownerLayers=this.owner.structuralLayers()//rejectduplicatelayeractivationsreturnlayers.concat(ownerLayers.reject(function(ea){returnlayers.include(ea)}))}returnlayers},activeLayers:function(){returnthis.structuralLayers()}})MyStructuralObject.subclass('MyCombineObject',{activeLayers:function(){vardefaultLayerActivations=composeLayers(LayerActivationStack,LayerActivationStack.length-1)varstructuralWithoutDefaultLayers=this.structuralLayers().reject(function(ea){returndefaultLayerActivations.include(ea)})returndefaultLayerActivations.concat(structuralWithoutDefaultLayers)}})//BenchmarksCopBenchmark.benchmarksToRun=[{name:"PLAINo.foo1()",run:function(name){varo=newMyObject();console.profile()CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo1(i)}})console.profileEnd()}},{name:"Wrapo.foo1()",run:function(name){varo=newMyObject();o.foo1=o.foo1.wrap(function(p,v){p(v)+v})CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo1(i)}})}},{name:"activeLayersPLAIN",run:function(name){varo=newMyObject();o.activeLayers=function(){return[]};CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"D+Gbutnoactivation",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"D+G1globallayer",run:function(name){varo=newMyObject();enableLayer(MyLayer);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer);}},{name:"D+G2globallayer",run:function(name){varo=newMyObject();enableLayer(MyLayer);enableLayer(MyLayer2);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer);disableLayer(MyLayer2);}},{name:"D+G3globallayer",run:function(name){varo=newMyObject();enableLayer(MyLayer);enableLayer(MyLayer2);enableLayer(MyLayer3);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer);disableLayer(MyLayer2);disableLayer(MyLayer3);}},{name:"D+G4globallayer",run:function(name){varo=newMyObject();enableLayer(MyLayer);enableLayer(MyLayer2);enableLayer(MyLayer3);enableLayer(MyLayer4);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer);disableLayer(MyLayer2);disableLayer(MyLayer3);disableLayer(MyLayer4);}},{name:"D+G5globallayer",run:function(name){varo=newMyObject();enableLayer(MyLayer);enableLayer(MyLayer2);enableLayer(MyLayer3);enableLayer(MyLayer4);enableLayer(MyLayer5);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer);disableLayer(MyLayer2);disableLayer(MyLayer3);disableLayer(MyLayer4);disableLayer(MyLayer5);}},{name:"D+Gwith1layer",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){withLayers([MyLayer],function(){for(vari=0;i<size;i++){o.foo2(i)}})})}},{name:"D+Gwith2layer",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){withLayers([MyLayer],function(){withLayers([MyLayer2],function(){for(vari=0;i<size;i++){o.foo2(i)}})})})}},{name:"D+Gwith3layer",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){withLayers([MyLayer],function(){withLayers([MyLayer2],function(){withLayers([MyLayer3],function(){for(vari=0;i<size;i++){o.foo2(i)}})})})})}},{name:"D+Gwith4layer",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){withLayers([MyLayer],function(){withLayers([MyLayer2],function(){withLayers([MyLayer3],function(){withLayers([MyLayer4],function(){for(vari=0;i<size;i++){o.foo2(i)}})})})})})}},{name:"D+Gwith5layer",run:function(name){varo=newMyObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){withLayers([MyLayer],function(){withLayers([MyLayer2],function(){withLayers([MyLayer3],function(){withLayers([MyLayer4],function(){withLayers([MyLayer4],function(){for(vari=0;i<size;i++){o.foo2(i)}})})})})})})}},{name:"S+Inoactivation",run:function(name){varo=newMyStructuralObject();o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I1layer",run:function(name){varo=newMyStructuralObject();o.setWithLayers([MyLayer])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I2layer",run:function(name){varo=newMyStructuralObject();o.setWithLayers([MyLayer,MyLayer2])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I3layer",run:function(name){varo=newMyStructuralObject();o.setWithLayers([MyLayer,MyLayer2,MyLayer3])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I4layer",run:function(name){varo=newMyStructuralObject();o.setWithLayers([MyLayer,MyLayer2,MyLayer3,MyLayer4])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I5layer",run:function(name){varo=newMyStructuralObject();o.setWithLayers([MyLayer,MyLayer2,MyLayer3,MyLayer4,MyLayer5])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayer,1ownerdepth",run:function(name){varp1=newMyStructuralObject();varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayer,2ownerdepth",run:function(name){varp2=newMyStructuralObject();varp1=newMyStructuralObject(p2);varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayer,3ownerdepth",run:function(name){varp3=newMyStructuralObject();varp2=newMyStructuralObject(p3);varp1=newMyStructuralObject(p2);varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayer,4ownerdepth",run:function(name){varp4=newMyStructuralObject();varp3=newMyStructuralObject(p4);varp2=newMyStructuralObject(p3);varp1=newMyStructuralObject(p2);varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayer,5ownerdepth",run:function(name){varp5=newMyStructuralObject();varp4=newMyStructuralObject(p5);varp3=newMyStructuralObject(p4);varp2=newMyStructuralObject(p3);varp1=newMyStructuralObject(p2);varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+Inolayerdef,5ownerdepth",run:function(name){varp5=newMyStructuralObject();varp4=newMyStructuralObject(p5);varp3=newMyStructuralObject(p4);varp2=newMyStructuralObject(p3);varp1=newMyStructuralObject(p2);varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo1(i)}})}},{name:"S+I1layer,1ownerdepth",run:function(name){varp1=newMyStructuralObject();p1.setWithLayers([MyLayer])varo=newMyStructuralObject(p1);CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I2layer,2ownerdepth",run:function(name){varp2=newMyStructuralObject();p2.setWithLayers([MyLayer2])varp1=newMyStructuralObject(p2);p1.setWithLayers([MyLayer])varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I3layer,3ownerdepth",run:function(name){varp3=newMyStructuralObject();p3.setWithLayers([MyLayer3])varp2=newMyStructuralObject(p3);p2.setWithLayers([MyLayer2])varp1=newMyStructuralObject(p2);p1.setWithLayers([MyLayer])varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I4layer,4ownerdepth",run:function(name){varp4=newMyStructuralObject();p4.setWithLayers([MyLayer4])varp3=newMyStructuralObject(p4);p3.setWithLayers([MyLayer3])varp2=newMyStructuralObject(p3);p2.setWithLayers([MyLayer2])varp1=newMyStructuralObject(p2);p1.setWithLayers([MyLayer])varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I5layer,5ownerdepth",run:function(name){varp5=newMyStructuralObject();p5.setWithLayers([MyLayer5])varp4=newMyStructuralObject(p5);p4.setWithLayers([MyLayer4])varp3=newMyStructuralObject(p4);p3.setWithLayers([MyLayer3])varp2=newMyStructuralObject(p3);p2.setWithLayers([MyLayer2])varp1=newMyStructuralObject(p2);p1.setWithLayers([MyLayer])varo=newMyStructuralObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I+G+Dnolayer,noowner",run:function(name){varo=newMyCombineObject();CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I+G+D1layer,1ownerdepth",run:function(name){varp1=newMyCombineObject();p1.setWithLayers([MyLayer])varo=newMyCombineObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I+G+D1Slayer,1ownerdepth",run:function(name){varp1=newMyCombineObject();p1.setWithLayers([MyLayer])varo=newMyCombineObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})}},{name:"S+I+G+D1S,1Glayer,1o.",run:function(name){varp1=newMyCombineObject();p1.setWithLayers([MyLayer])enableLayer(MyLayer2)varo=newMyCombineObject(p1);o.setWithLayers([])CopBenchmark.benchmarkBlock(name,1,function(size,obj){for(vari=0;i<size;i++){o.foo2(i)}})disableLayer(MyLayer2)}},{name:"S+I+G+D1S,1G,1Dlayer,1o.",run:function(name){varp1=newMyCombineObject();p1.setWithLayers([MyLayer])enableLayer(MyLayer2)varo=newMyCombineObject(p1);o.setWithLayers([])CopBenchmark.benchmakeBlock(name,1,function(size,obj){withLayers([MyLayer3],function(){for(vari=0;i<size;i++){o.foo2(i)}})})disableLayer(MyLayer2)}},]CopBenchmark.runDelayed=functionrunDelayed(){varbenchmark=CopBenchmark.benchmarksToRun.shift();if(!benchmark){CopBenchmark.printResults();return};//console.log("run"+benchmark.name)console.profile(benchmark.name);benchmark.run(benchmark.name);console.profileEnd(benchmark.name);Global.setTimeout(runDelayed,10);};CopBenchmark.result="ContextJSBenchmark\n"+"Date:\t"+newDate()+"\n"+"Browser:\t"+navigator.userAgent+"\n"+"Revision:\t"+WikiNavigator.current.model.getOriginalRevision()+"\n"+"name\topstimeops/time\n";CopBenchmark.runDelayed();truetruefalse7truetruefalse
0.00048859323631267330.11
true
truetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
nullfalsefalsenullnullnullnullfalse
null69