Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
assign test sldqoidqdoiqhoqffdd
(version: 0)
Comparing performance of:
assign vs big assign
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
state = { "table1": { "itemid1": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid2": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid3": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid4": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid5": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid6": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid7": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid8": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid9": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid10": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid11": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid12": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"} }, "table2": { "itemid1": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid2": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid3": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid4": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid5": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid6": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid7": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid8": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid9": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid10": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid11": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid12": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"} } } item = {"a": "qdqsfffffff", "b": 21244, "c": 0.11, "d": "sdlqsfq4qq"} items = {"table1": { "itemid1": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhddsqdqd"}, "itemid2": {"a": "az8e", "b": 21.5, "c": 0.547577, "d": "qsd"}, "itemid3": {"a": "aze", "b": 21.58, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid4": {"a": "aze", "b": 2661.5, "c": 0.64, "d": "adqdfqhdsqdqd"}, "itemid5": {"a": "a1ze", "b": 21.5, "c": 0.54577, "d": "f"}, "itemid6": {"a": "aze", "b": 21.5, "c": 0.5874577, "d": "adqdqhdsqdqd"},}, "table2":{ "itemid7": {"a": "az025e", "b": 2144.5, "c": 0.545767, "d": "adqdffqhdsqdqd"}, "itemid8": {"a": "aze", "b": 21.5, "c": 0.545477, "d": "adqdqhqdsqdqd"}, "itemid9": {"a": "az3e", "b": 21.35, "c": 0.545577, "d": "adqdqhdsqdqd"}, "itemid10": {"a": "aze", "b": 21.5, "c": 0.54377, "d": "adqdqqfqhdsqdqd"}, "itemid11": {"a": "az3e", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"}, "itemid12": {"a": "aze", "b": 21.5, "c": 0.54577, "d": "adqdqhdsqdqd"} }} function deepMerge(obj1, obj2) { // Create a new object that combines the properties of both input objects const merged = Object.assign(obj1, obj2) // Loop through the properties of the merged object for (const key of Object.keys(merged)) { // Check if the property is an object if (typeof merged[key] === 'object' && merged[key] !== null) { // If the property is an object, recursively merge the objects merged[key] = deepMerge(obj1[key], obj2[key]); } } return merged; }
Tests:
assign
output = Object.assign(state["table2"]["itemid1"], item) output = Object.assign(state["table2"]["itemid2"], item) output = Object.assign(state["table2"]["itemid3"], item) output = Object.assign(state["table2"]["itemid4"], item) output = Object.assign(state["table2"]["itemid5"], item) output = Object.assign(state["table2"]["itemid6"], item) output = Object.assign(state["table2"]["itemid7"], item) output = Object.assign(state["table1"]["itemid1"], item) output = Object.assign(state["table1"]["itemid2"], item) output = Object.assign(state["table1"]["itemid3"], item) output = Object.assign(state["table1"]["itemid4"], item) output = Object.assign(state["table1"]["itemid5"], item)
big assign
output = deepMerge(state, items)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
assign
big assign
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):
It looks like we have a benchmarking result and some code snippets, but I'll need to extract the relevant information. **Benchmark Result** The latest benchmark results are: 1. `assign` test: * Raw UA string: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.79" * Browser: Chrome 114 * Device platform: Desktop * Operating system: Windows * Executions per second: 136290.25 * Test name: "assign" 2. `big assign` test: * Raw UA string: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.79" * Browser: Chrome 114 * Device platform: Desktop * Operating system: Windows * Executions per second: 132088.203125 * Test name: "big assign" **Code Snippets** We have two code snippets: 1. `assign` test: ```javascript output = Object.assign(state["table2"]["itemid1"], item) output = Object.assign(state["table2"]["itemid2"], item) output = Object.assign(state["table2"]["itemid3"], item) output = Object.assign(state["table2"]["itemid4"], item) output = Object.assign(state["table2"]["itemid5"], item) output = Object.assign(state["table2"]["itemid6"], item) output = Object.assign(state["table2"]["itemid7"], item) output = Object.assign(state["table1"]["itemid1"], item) output = Object.assign(state["table1"]["itemid2"], item) output = Object.assign(state["table1"]["itemid3"], item) output = Object.assign(state["table1"]["itemid4"], item) output = Object.assign(state["table1"]["itemid5"], item) ``` 2. `big assign` test: ```javascript output = deepMerge(state, items) ``` **Function** We have a function called `deepMerge` that is used in the `big assign` test: ```javascript function deepMerge(obj1, obj2) { const merged = Object.assign(obj1, obj2) for (const key of Object.keys(merged)) { if (typeof merged[key] === 'object' && merged[key] !== null) { merged[key] = deepMerge(obj1[key], obj2[key]); } } return merged; } ``` Let me know what you'd like to know or what the next steps are!
Related benchmarks:
Test Immutable ToJS vs get
Test Immutable ToJS vs single get
reduce me test 000009
reduce spread vs reduce
Lodash Filter vs Native Filter with Empty Check in Lodash context with other operations
Comments
Confirm delete:
Do you really want to delete benchmark?