Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Fly Json ODM - 1.16.0
(version: 6)
Benchmark using Fly Json ODM in browser for 1million array objects
Comparing performance of:
SET + WHERE vs SET + WHERE (Shallow Mode)
Created:
5 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/fly-json-odm@1.16.0/dist/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 }); }
Tests:
SET + WHERE
var result = nosql.set(data).where('id',1000000).exec();
SET + WHERE (Shallow Mode)
var result = nosql.setMode('shallow').set(data).where('id',1000000).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):
Let's break down the provided JSON data to understand what is being tested in this JavaScript microbenchmark. **Benchmark Definition** The benchmark definition represents a script that creates an instance of `FlyJson` and pushes 1 million array objects with `id` and `name` properties into it. The script then performs two different tests: 1. **SET + WHERE**: This test sets the data using the `set()` method and then filters the results using the `where()` method to retrieve documents where the `id` property equals 1000000. 2. **SET + WHERE (Shallow Mode)**: This test is similar to the first one, but it uses the `shallow` mode when setting the data using `setMode('shallow').set()`. The purpose of shallow mode is not explicitly stated in the benchmark definition, but it likely optimizes the performance by reducing the amount of memory allocated for the document objects. **Comparison Options** The two test cases are compared in terms of their execution speed. The benchmark measures the number of executions per second (ExecutionsPerSecond) for each test case. **Pros and Cons of Different Approaches** 1. **SET + WHERE**: This approach is straightforward and likely provides optimal performance, as it uses the most efficient way to retrieve documents. * Pros: Fast execution speed * Cons: May not be optimized for performance due to shallow mode 2. **SET + WHERE (Shallow Mode)**: This approach optimizes memory allocation by reducing the amount of data required for document objects. * Pros: Potential performance improvement due to reduced memory usage * Cons: May have a slight impact on execution speed, as it may require more processing time **Library and Purpose** The `FlyJson` library is used in this benchmark. FlyJson is an open-source JavaScript NoSQL database for browser-based applications. Its primary purpose is to provide a simple way to store, retrieve, and query data in a NoSQL database. In the context of this benchmark, FlyJson is used as a key-value store with basic CRUD (Create, Read, Update, Delete) operations. **Special JS Feature or Syntax** There is no specific JavaScript feature or syntax being tested in this benchmark. The focus is on comparing the performance of two different approaches to retrieve documents from a NoSQL database using FlyJson. **Other Considerations** When interpreting the results, consider the following: * The `ExecutionsPerSecond` metric may not accurately represent the performance difference between the two test cases, as it only measures the number of executions per second. Other factors like memory usage and processing time may also impact performance. * The benchmark definition assumes that the `FlyJson` library is properly configured and initialized before running the tests. **Alternative Benchmarks** Other alternatives for benchmarking JavaScript microbenchmarks include: * Jest or Mocha with a NoSQL database integration * Benchmark.js, which provides a simple way to run benchmarks and compare results * V8 Profiler (for Node.js), which allows you to profile and optimize your code Note that each of these alternatives may have its own strengths and weaknesses, and the choice of benchmarking library or tool will depend on specific requirements and use cases.
Related benchmarks:
Fly Json ODM - 1.8.4 Browser
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?