Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
js search benchmark
(version: 1)
Comparing performance of:
Lunr vs js search vs minisearch vs fuse.js
Created:
2 years ago
by:
Registered User
Jump to the latest result
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)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Lunr
js search
minisearch
fuse.js
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:144.0) Gecko/20100101 Firefox/144.0
Browser/OS:
Firefox 144 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lunr
3173895.2 Ops/sec
js search
10507306.0 Ops/sec
minisearch
1525388.1 Ops/sec
fuse.js
1076286.4 Ops/sec
Related benchmarks:
Native XHR vs jQuery Ajax
Vanilla vs Jquery OPS/SEC 2
test23123
Vanilla JS VS JQuery DOM perfomance Loop
Comparison Ajax, Fecth and XHR
Comments
Confirm delete:
Do you really want to delete benchmark?