Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
js search benchmark
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0
Browser:
Firefox 138
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lunr
1929074.4 Ops/sec
js search
0.0 Ops/sec
minisearch
952913.8 Ops/sec
fuse.js
540239.4 Ops/sec
HTML Preparation code:
<script src="https://unpkg.com/lunr/lunr.js"></script> <script type="text/javascript" src="https://rawgit.com/bvaughn/js-search/1.2.0/dist/js-search.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/minisearch@2.2.2/dist/umd/index.min.js"></script> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.js"></script> <script> Benchmark.prototype.setup = function() { var books = []; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var json = JSON.parse(xmlhttp.responseText); books = json.books; } } xmlhttp.open('GET', 'http://bvaughn.github.io/js-search/books.json', true); xmlhttp.send(); }; </script>
Tests:
Lunr
var idx = lunr(function () { this.ref('isbn'); this.field('title'); this.field('author'); books.forEach(function (doc) { this.add(doc) }, this); })
js search
var search = new JsSearch.Search('isbn'); search.searchIndex = new JsSearch.TfIdfSearchIndex('isbn'); search.addIndex('title'); search.addIndex('author'); search.addDocuments(books);
minisearch
var miniSearch = new MiniSearch({ fields: ['isbn', 'title', 'author'], // fields to index for full-text search }); miniSearch.addAll(books)
fuse.js
const options = { includeScore: true, keys: ['isbn', 'title', 'author'] } const fuse = new Fuse(books, options)