Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
js browser search
(version: 0)
Comparing performance of:
Lunr vs js search vs minisearch
Created:
2 years ago
by:
Guest
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@6.1.0/dist/umd/index.min.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)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lunr
js search
minisearch
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 26_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/142.0.7444.148 Mobile/15E148 Safari/604.1
Browser/OS:
Chrome Mobile iOS 142 on iOS 26.0.1
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lunr
4407712.5 Ops/sec
js search
14918709.0 Ops/sec
minisearch
1983992.0 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
The provided benchmark, MeasureThat.net, tests the performance of three JavaScript search libraries: Lunr, JsSearch, and Minisearch. **Lunr** The Lunr library is used for full-text searching. It provides an index that can be populated with documents, which are then searchable. * **Options compared:** The benchmark compares the execution time of a simple index setup using Lunr. * **Pros:** * Simple to set up and use * Efficient for small to medium-sized datasets * Supports multiple fields for searching (e.g., title, author) * **Cons:** * May not be efficient for very large datasets * Limited support for advanced search features **JsSearch** The JsSearch library is a full-text search engine that provides more features than Lunr. It supports various indexing algorithms and allows for custom indexing. * **Options compared:** The benchmark compares the execution time of setting up a simple index using JsSearch. * **Pros:** * More feature-rich than Lunr * Supports multiple indexing algorithms (e.g., TF-IDF) * Allows for custom indexing * **Cons:** * More complex to set up and use compared to Lunr * May require more resources (CPU, memory) due to additional features **Minisearch** The Minisearch library is a lightweight full-text search engine designed for small datasets. * **Options compared:** The benchmark compares the execution time of setting up a simple index using Minisearch. * **Pros:** * Extremely lightweight (only 2KB) and efficient * Simple to set up and use * Supports multiple fields for searching * **Cons:** * May not be suitable for very large datasets due to limited resources **Library details:** 1. Lunr: * [Lunr Documentation](https://github.com/leejackson/lunr): A lightweight, open-source full-text search library. 2. JsSearch: * [JsSearch Documentation](https://jssearch.net/docs/): A full-text search engine that provides a more feature-rich alternative to Lunr. 3. Minisearch: * [Minisearch Documentation](https://minisearch.org/): A lightweight, open-source full-text search library designed for small datasets. **Browser-specific features:** The provided benchmark result shows the performance of each search library in a Chrome browser (Chrome 117) on a Mac OS X 10.15.7 desktop environment. * The **RawUAString** field indicates the User Agent string, which is used to identify the browser and device. * The **ExecutionsPerSecond** value represents the average number of searches performed per second in each test case. In conclusion, MeasureThat.net provides a comprehensive benchmark for evaluating the performance of JavaScript search libraries. By comparing different options and understanding their strengths and weaknesses, developers can choose the most suitable library for their specific use cases.
Related benchmarks:
Fuzzy search 4
js search
Comparison Ajax, Fecth and XHR
js search benchmark
Comments
Confirm delete:
Do you really want to delete benchmark?