Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Fly Json ODM
(version: 0)
Benchmark using Fly Json ODM for WHERE in browser
Comparing performance of:
WHERE vs SELECT + WHERE vs SELECT + WHERE + LIMIT
Created:
6 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/fly-json-odm@1.6.0/src/flyjson.min.js"></script>
Script Preparation code:
var nosql = new FlyJson(); var data = []; var start = 1; var end = 1000000; for(var i =start;i<=end;i++) { data.push({ id:i, name:'user_'+i }); } nosql.set(data);
Tests:
WHERE
var result = nosql.where('id',1000000).exec();
SELECT + WHERE
var result = nosql.select(['id','name']).where('id',1000000).exec();
SELECT + WHERE + LIMIT
var result = nosql.select(['id','name']).where('id',1000000).take(1).exec();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
WHERE
SELECT + WHERE
SELECT + WHERE + LIMIT
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):
Let's break down the provided JSON and explain what's being tested in this benchmark. **Overview** MeasureThat.net is a website that allows users to create and run JavaScript microbenchmarks. The provided JSON represents a benchmark definition for Fly Json ODM, which is a NoSQL database library. **Benchmark Definition** The `Script Preparation Code` section defines the script used to prepare the test data: ```javascript var nosql = new FlyJson(); var data = []; var start = 1; var end = 1000000; for(var i = start; i <= end; i++) { data.push({ id: i, name: 'user_' + i }); } nosql.set(data); ``` This script creates a new instance of the Fly Json ODM library (`nosql`), initializes an empty array `data`, and populates it with 1 million objects. The `set()` method is then used to set the data in the NoSQL database. The `Html Preparation Code` section includes a link to the Fly Json ODM library: ```html <script src="https://cdn.jsdelivr.net/npm/fly-json-odm@1.6.0/src/flyjson.min.js"></script> ``` **Individual Test Cases** There are three individual test cases, each defined in the `Benchmark Definition` section: 1. **WHERE** ```javascript var result = nosql.where('id', 1000000).exec(); ``` This test case uses the `where()` method to filter data based on a condition (`id = 1000000`) and measures the execution time. 2. **SELECT + WHERE** ```javascript var result = nosql.select(['id', 'name']).where('id', 1000000).exec(); ``` This test case combines the `select()` method with the `where()` method to filter data based on multiple conditions (`id = 1000000` and an implicit `name` filter). 3. **SELECT + WHERE + LIMIT** ```javascript var result = nosql.select(['id', 'name']).where('id', 1000000).take(1).exec(); ``` This test case adds a `limit()` method to the previous test case, which returns only the first 1 item that matches the filter (`id = 1000000`). **Options Compared** The three test cases compare different approaches: * **WHERE**: uses a single filter condition * **SELECT + WHERE**: combines filtering with selecting specific fields * **SELECT + WHERE + LIMIT**: adds a limit to the previous approach **Pros and Cons** Here are some pros and cons of each approach: 1. **WHERE**: * Pros: simple, efficient * Cons: may not be suitable for complex queries or large datasets 2. **SELECT + WHERE**: * Pros: allows filtering while still selecting specific fields, can be more efficient than individual `where()` calls * Cons: adds complexity to the query, may impact performance if too many fields are selected 3. **SELECT + WHERE + LIMIT**: * Pros: adds an explicit limit to the previous approach, can help prevent large result sets from being returned * Cons: may impact performance due to the added overhead of the `take()` method **Library and Syntax** Fly Json ODM is a NoSQL database library that provides a simple API for working with data. The `where()`, `select()`, and `limit()` methods are part of this library. There are no special JavaScript features or syntax used in these benchmarks, just standard ECMAScript 5+ syntax. **Alternatives** If you're looking for alternatives to Fly Json ODM, some options include: * MongoDB: a popular NoSQL database that can be used with Node.js and other languages * Couchbase: a NoSQL database that provides similar features to Fly Json ODM * Firebase Realtime Database or Cloud Firestore: cloud-hosted NoSQL databases provided by Google
Related benchmarks:
Fly Json ODM - 1.16.0
Fly Json ODM - 1.18.2
Fly Json ODM - 1.18.2 - Medium 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?