From 006758701965d049bfef6cece7d79e12d4f3e4a7 Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Wed, 5 Mar 2025 13:00:42 +0100 Subject: [PATCH] update libs to latest --- bench.js | 44 ++--------------- index.html | 32 ++++++++---- index.js | 84 ++++++++++++++++---------------- test/flexsearch-0.7.0/index.html | 2 +- test/flexsearch-0.8.0/index.html | 2 +- test/fuse/index.html | 6 +-- test/js-search/index.html | 6 +-- test/lunr/index.html | 6 +-- test/lyra/index.html | 2 +- test/minisearch/index.html | 6 +-- test/orama/index.html | 52 ++++++++++++++++++++ test/wade/index.html | 2 +- tpl/row.html | 4 +- tpl/row.js | 12 ++--- 14 files changed, 145 insertions(+), 115 deletions(-) create mode 100644 test/orama/index.html diff --git a/bench.js b/bench.js index 0fd980d..5a727ae 100644 --- a/bench.js +++ b/bench.js @@ -167,6 +167,7 @@ queue.push({ count: 25 }); +/* queue.push({ name: "query-dupes", init: null, @@ -181,6 +182,7 @@ queue.push({ complete: null, count: 7 }); +*/ queue.push({ name: "not-found", @@ -256,15 +258,13 @@ async function perform(){ let cycle = 1, max_cycle = test.cycle, inner_count = test.count; let elapsed = 0, memory = 0; let loops = 0, now = 0; - let start, mem_start, mem; if(status){ if(test.init) test.init(); - const end = perf.now() + duration; let start, mem_start, mem; - while(now < end){ + while(elapsed < duration){ if(test.start) test.start(loops); @@ -272,11 +272,10 @@ async function perform(){ mem_start = perf.memory.usedJSHeapSize; start = perf.now(); for(let i = 0; i < cycle; i++) test.fn(); - now = perf.now(); + elapsed += perf.now() - start; mem = perf.memory.usedJSHeapSize - mem_start; // -- END ------------------- - elapsed += (now - start); if(mem > 0) memory += mem; if(test.end) test.end(loops); loops += cycle; @@ -288,41 +287,6 @@ async function perform(){ if(max_cycle && (cycle > max_cycle)){ cycle = max_cycle; } - - // mem_start = perf.memory.usedJSHeapSize; - // start = performance.now(); - // for(let i = 0; i < cycle; i++) test.fn(); - // elapsed += (performance.now() - start); - // mem = perf.memory.usedJSHeapSize - mem_start; - // loops += cycle; - // if(mem > 0) memory += mem; - // if(test.end) test.end(loops); - - // console.log(test.name); - // console.log("duration", duration); - // console.log("elapsed", elapsed); - // console.log("cycle", cycle); - // console.log("loops", loops); - - //if(cycle ===1) cycle = cycle * (duration / (elapsed || 1)) | 0; - - // console.log("loops", loops, "elapsed", elapsed, "duration", duration, "cycle", (loops / (elapsed || 1) * (duration - elapsed)) | 0); - // - // //cycle = (loops / (elapsed || 1) * (duration - elapsed) * 1.2) | 0; - // //cycle *= loops / (elapsed || 1) * (duration - elapsed) / 2 | 0; - // cycle *= duration / (elapsed || 1); - // if(cycle < 1){ - // break; - // } - // - // //cycle = loops / (elapsed || 1) * (duration - elapsed); - // - // if(max_cycle && (cycle > max_cycle)){ - // cycle = max_cycle; - // } - // - // //console.log(elapsed, duration, cycle) - // //await new Promise(resolve => setTimeout(resolve, 50)); } if(test.complete) test.complete(); diff --git a/index.html b/index.html index 712ad50..b98103b 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,6 @@ + Benchmark of Web Templating Engines (Non-Keyed)