Skip to content

Commit

Permalink
update benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-thomas committed Jan 20, 2024
1 parent 1b9efea commit ce64fdc
Show file tree
Hide file tree
Showing 19 changed files with 191 additions and 257 deletions.
45 changes: 20 additions & 25 deletions bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,11 @@ function next(){

copy(generate(DATA_SIZE), items);
}
// else if(keyed){
//
// items = enforce(factory[pos]);
// }
else /*if(strict || recycle)*/{
else{

items = generate(DATA_SIZE);
}

// if(++pos === factory.length){
//
// pos = 0;
// }

return items;
}

Expand Down Expand Up @@ -112,9 +103,7 @@ function enforce(data){

queue.push({
name: "create",
init: function(){
//start empty
},
init: null,
test: null,
start: null,
prepare: function(){
Expand Down Expand Up @@ -217,15 +206,15 @@ queue.push({
queue.push({
name: "repaint",
init: function(){
//start pre-filled, cache data
//start pre-filled
this.fn(clone = next());
},
test: null,
start: function(){
start: null,
prepare: function(){
// prepare unchanged data to render
clone = enforce(clone);
},
prepare: null,
fn: null,
end: null,
complete: function(){
Expand All @@ -239,11 +228,12 @@ let tmp;

queue.push({
name: "append",
init: null,
init: function(){
//create data
clone = next();
},
test: null,
start: function(){
//create full data
clone = next();
//divide data into 2 parts
tmp = clone.splice(DATA_SIZE_HALF);
//start pre-filled of first half data
Expand All @@ -264,19 +254,24 @@ queue.push({

queue.push({
name: "remove",
init: null,
init: function(){
//create data
clone = next();
},
test: null,
start: function(){
//start pre-filled, cache data
this.fn(clone = next());
this.fn(clone);
// prepare data to render by remove the 2nd half
tmp = clone.splice(DATA_SIZE_HALF);
},
prepare: function(){
// prepare data to render by remove the 2nd half
clone.splice(DATA_SIZE_HALF);
clone = enforce(clone);
},
fn: null,
end: null,
end: function(){
clone = clone.concat(tmp);
},
complete: function(){
// removes everything (teardown)
clone.splice(0);
Expand All @@ -286,7 +281,7 @@ queue.push({

queue.push({
name: "toggle",
init: function(){
init: function(index){
//start pre-filled, cache data
this.fn(clone = next());
},
Expand Down
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const Mikado = window.Mikado;
const iframe = document.getElementById("iframe");
const mikado_table = Mikado("row").mount(document.getElementById("result"));
const mikado_table = Mikado("row", { recycle: true, cache: true }).mount(document.getElementById("result"));
const mikado_list = Mikado("lib").mount(document.getElementById("lib"));

Mikado.eventCache = true;
Expand All @@ -24,7 +24,8 @@
"mode-keyed-shared", "mode-non-keyed", "mode-proxy",
"mode-array", "mode-array-proxy"
]:[
"mikado", "mikado-proxy", "mikado-shadow", //"mikado-0.7.6", "mikado-proxy-0.7.6", "mikado-0.7.5", "mikado-0.7.4",
"mikado", "mikado-proxy", "mikado-shadow",
//"mikado-0.8.2", "mikado-0.7.6", "mikado-proxy-0.7.6", "mikado-0.7.5", "mikado-0.7.4",
"stage0", "solid", "domc", "inferno",
"redom", "sinuous", "surplus",
"innerHTML", "jquery", "mithril",
Expand Down
111 changes: 56 additions & 55 deletions test/mikado-proxy/dist/mikado.bundle.module.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/mikado-proxy/template/keyed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/mikado-proxy/template/proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/mikado-proxy/template/template.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce64fdc

Please sign in to comment.