1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-24 20:41:28 +02:00

cleanup benchmark tests

This commit is contained in:
Thomas Wilkerling
2025-03-09 17:06:54 +01:00
parent 8e6c1b81d8
commit 89117cc4d7
18 changed files with 91 additions and 29 deletions

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,26 +2,27 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: flexsearch-0.7.0</title>
</head>
<body>
<h2>Benchmark: flexsearch-0.7.0</h2><hr/>
<h4>Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)</h4>
<div id="result" style="white-space: pre; font-family: Monospaced, monospace"></div>
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/master/dist/flexsearch.light.min.js"></script>
<script type="module">
import Index from "https://rawcdn.githack.com/nextapps-de/flexsearch/0.7.31/dist/module/index.js";
import { suite } from "../../bench.js";
let lib, split = /[^a-z]+/;
suite["flexsearch-0.7.0"] = {
init: function(){
lib = new FlexSearch.Index({
lib = new Index({
encode: str => str.toLowerCase().split(split),
tokenize: "strict",
resolution: 1,
cache: false,
optimize: false,
fastupdate: false,
context: {

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: flexsearch-0.8.0-cache</title>
</head>
<body>
<h2>Benchmark: flexsearch-0.8.0-cache</h2><hr/>
<h4>Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)</h4>
<p style="color: #f00">This test is using query cache and is outside the competition! It is just there for completion.</p>
<div id="result" style="white-space: pre; font-family: Monospaced, monospace"></div>
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/flexsearch.light.min.js"></script>
<script type="module">
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/module-min/lang/en.js";
import { suite } from "../../bench.js";
let lib;
suite["flexsearch-0.8.0-cache"] = {
init: function(){
lib = new FlexSearch.Index({
encoder: EnglishPreset,
tokenize: "strict",
resolution: 1,
cache: true,
context: {
depth: 1,
bidirectional: false,
resolution: 1
}
});
},
add: function(data){
for(let i = 0, len = data.length; i < len; i++){
lib.add(i, data[i]);
}
},
query: function(query){
return lib.searchCache(query, 9999);
},
update: function(data){
for(let i = 0, len = data.length; i < len; i++){
lib.update(i, data[i]);
}
},
remove: function(data){
for(let i = 0, len = data.length; i < len; i++){
lib.remove(i);
}
}
};
</script>
</body>
</html>

View File

@@ -2,32 +2,32 @@
<html>
<head>
<meta charset="utf-8">
<title>Benchmark</title>
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: flexsearch-0.8.0-soundex</title>
</head>
<body>
<h2>Benchmark: flexsearch-0.8.0</h2><hr/>
<h2>Benchmark: flexsearch-0.8.0-soundex</h2><hr/>
<h4>Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)</h4>
<div id="result" style="white-space: pre; font-family: Monospaced, monospace"></div>
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/flexsearch.compact.min.js"></script>
<script type="module">
import Index from "https://rawcdn.githack.com/nextapps-de/flexsearch/112c30f50fc1fc27390ba25b475336298b5817fe/index.js";
import Encoder from "https://rawcdn.githack.com/nextapps-de/flexsearch/112c30f50fc1fc27390ba25b475336298b5817fe/encoder.js";
import SoundexEncoder from "https://rawcdn.githack.com/nextapps-de/flexsearch/112c30f50fc1fc27390ba25b475336298b5817fe/lang/latin/soundex.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/112c30f50fc1fc27390ba25b475336298b5817fe/lang/en.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/module-min/lang/en.js";
import { suite } from "../../bench.js";
let lib;
suite["flexsearch-0.8.0"] = {
suite["flexsearch-0.8.0-soundex"] = {
init: function(){
lib = new Index({
lib = new FlexSearch.Index({
encoder: new FlexSearch.Encoder(
FlexSearch.Charset.LatinSoundex,
EnglishPreset
),
tokenize: "strict",
resolution: 1,
encoder: new Encoder(
EnglishPreset,
SoundexEncoder
),
cache: false,
context: {
depth: 1,
bidirectional: false,

View File

@@ -9,18 +9,10 @@
<h2>Benchmark: flexsearch-0.8.0</h2><hr/>
<h4>Indexed Text: "Gulliver's Travels" (Swift Jonathan 1726)</h4>
<div id="result" style="white-space: pre; font-family: Monospaced, monospace"></div>
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/5532ff3b82906fd8c0595840505174b928916a55/dist/flexsearch.compact.min.js"></script>
<script src="https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/flexsearch.light.min.js"></script>
<script type="module">
// import Index from "https://rawcdn.githack.com/nextapps-de/flexsearch/5532ff3b82906fd8c0595840505174b928916a55/index.js";
// import Encoder from "https://rawcdn.githack.com/nextapps-de/flexsearch/5532ff3b82906fd8c0595840505174b928916a55/encoder.js";
import DefaultEncoder from "https://rawcdn.githack.com/nextapps-de/flexsearch/5532ff3b82906fd8c0595840505174b928916a55/lang/latin/default.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/5532ff3b82906fd8c0595840505174b928916a55/lang/en.js";
// import Index from "../../../src/index.js";
// import Encoder from "../../../src/encoder.js";
// import DefaultEncoder from "../../../src/lang/latin/default.js";
// import EnglishPreset from "../../../src/lang/en.js";
import EnglishPreset from "https://rawcdn.githack.com/nextapps-de/flexsearch/v0.8-preview/dist/module-min/lang/en.js";
import { suite } from "../../bench.js";
let lib;
@@ -29,13 +21,10 @@
init: function(){
lib = new FlexSearch.Index({
encoder: EnglishPreset,
tokenize: "strict",
resolution: 1,
cache: false,
encoder: new FlexSearch.Encoder(
DefaultEncoder,
EnglishPreset
),
context: {
depth: 1,
bidirectional: false,

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: fuse-7.1.0</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: js-search-2.0.1</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: lunr-2.3.9</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: lyra-0.2.4</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: minisearch-7.1.2</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: orama-3.1.1</title>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<title>Benchmark: wade-0.3.3</title>
</head>
<body>