Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Fly Json ODM - 1.18.2 - Medium Size
(version: 0)
Benchmark using Fly Json ODM in browser with medium size (10K) array objects.
Comparing performance of:
SET + WHERE vs SET + WHERE (Shallow Mode)
Created:
2 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/fly-json-odm@1.18.2/dist/flyjson.min.js"></script>
Script Preparation code:
var nosql = new FlyJson(); var data = []; var start = 1; var end = 10000; for(var i =start;i<=end;i++) { data.push({ id:i, name:'user_'+i }); }
Tests:
SET + WHERE
var result = nosql.set(data).where('id',10000).exec();
SET + WHERE (Shallow Mode)
var result = nosql.setMode('shallow').set(data).where('id',10000).exec();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
SET + WHERE
SET + WHERE (Shallow Mode)
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll break down the benchmark and explain what's being tested. **Overview** The benchmark compares the performance of two approaches: setting data using `nosql.set()` followed by filtering with `where()` and executing with `exec()`, and setting data in shallow mode using `setMode('shallow')` before filtering with `where()` and executing with `exec()`. **Options Compared** 1. **`set()` + `where()` + `exec()`**: This is the default approach, where data is set using `nosql.set()`, filtered using `where()` to find a specific value (in this case, `id=10000`), and then executed. 2. **`setMode('shallow')` + `set()` + `where()` + `exec()`**: This approach sets data in shallow mode, which is expected to be faster than the default approach. Data is set using `nosql.setMode('shallow')`, followed by setting data using `set()`, filtering with `where()`, and finally executing with `exec()`. **Pros and Cons** 1. **Default Approach (`set()` + `where()` + `exec()`)**: * Pros: Simple, easy to implement. * Cons: May not be optimized for performance, especially when dealing with large datasets or complex queries. 2. **Shallow Mode Approach (`setMode('shallow')` + `set()` + `where()` + `exec()`)**: * Pros: Optimized for performance, especially when dealing with large datasets or complex queries. Can reduce memory usage and improve execution speed. * Cons: May be more complex to implement, requires knowledge of shallow mode specifics. **Library Used** The benchmark uses the Fly JSON ODM (Object Data Modeling) library, which is a JavaScript library for working with NoSQL data in browser environments. The library provides an API for setting, filtering, and executing data based on predefined queries. **Special JS Feature/Syntax** None mentioned explicitly, but it's worth noting that this benchmark uses modern JavaScript syntax and features like arrow functions (`() => {}`) and template literals (`''`). **Alternatives** If you're interested in exploring other alternatives for NoSQL data management in browser environments, some options include: 1. PouchDB: A popular open-source NoSQL database for the web. 2. IDB (Indexed Database API): A built-in JavaScript API for storing and retrieving data in Indexed Databases. 3. LevelUP: A lightweight NoSQL database library for Node.js and browsers. For JavaScript microbenchmarks like this one, MeasureThat.net is a great resource for comparing performance across different libraries and approaches.
Related benchmarks:
Fly Json ODM - 1.16.0
Fly Json ODM - 1.18.2 - Common Size
Fly Json ODM - 1.19.0 - Full
Fly Json ODM - 1.21.0 - Medium Size
Comments
Confirm delete:
Do you really want to delete benchmark?