Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
delete, spread, filter
(version: 0)
delete, spread, filter
Comparing performance of:
Delete object property vs Spread object vs Filter array
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var obj = { "1": true, "2": true, "3": true, "4": true, "5": true, "6": true, "7": true, "8": true, "9": true, "10": true, "11": true, "12": true, "13": true, "14": true, "15": true, "16": true, "17": true, "18": true, "19": true, "20": true, "21": true, "22": true, "23": true, "24": true, "25": true, "26": true, "27": true, "28": true, "29": true, "30": true, "31": true, "32": true, "33": true, "34": true, "35": true, "36": true, "37": true, "38": true, "39": true, "40": true, "41": true, "42": true, "43": true, "44": true, "45": true, "46": true, "47": true, "48": true, "49": true, "50": true, "51": true, "52": true, "53": true, "54": true, "55": true, "56": true, "57": true, "58": true, "59": true, "60": true, "61": true, "62": true, "63": true, "64": true, "65": true, "66": true, "67": true, "68": true, "69": true, "70": true, "71": true, "72": true, "73": true, "74": true, "75": true, "76": true, "77": true, "78": true, "79": true, "80": true, "81": true, "82": true, "83": true, "84": true, "85": true, "86": true, "87": true, "88": true, "89": true, "90": true, "91": true, "92": true, "93": true, "94": true, "95": true, "96": true, "97": true, "98": true, "99": true, "100": true, "101": true, "102": true, "103": true, "104": true, "105": true, "106": true, "107": true, "108": true, "109": true, "110": true, "111": true, "112": true, "113": true, "114": true, "115": true, "116": true, "117": true, "118": true, "119": true, "120": true, "121": true, "122": true, "123": true, "124": true, "125": true, "126": true, "127": true, "128": true, "129": true, "130": true, "131": true, "132": true, "133": true, "134": true, "135": true, "136": true, "137": true, "138": true, "139": true, "140": true, "141": true, "142": true, "143": true, "144": true, "145": true, "146": true, "147": true, "148": true, "149": true, "150": true, "151": true, "152": true, "153": true, "154": true, "155": true, "156": true, "157": true, "158": true, "159": true, "160": true, "161": true, "162": true, "163": true, "164": true, "165": true, "166": true, "167": true, "168": true, "169": true, "170": true, "171": true, "172": true, "173": true, "174": true, "175": true, "176": true, "177": true, "178": true, "179": true, "180": true, "181": true, "182": true, "183": true, "184": true, "185": true, "186": true, "187": true, "188": true, "189": true, "190": true, "191": true, "192": true, "193": true, "194": true, "195": true, "196": true, "197": true, "198": true, "199": true }; var arr = []; for (let n = 1; n < 200; n++) arr.push(`${n}`)
Tests:
Delete object property
for (const key in obj) { delete obj[key] }
Spread object
for (const key in obj) { const { [key]: v, ...rest } = data data = rest }
Filter array
for (const key in obj) { arr = arr.filter(x => x !== key) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Delete object property
Spread object
Filter array
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 provide an answer based on the provided information. **Benchmarking Data** The benchmarking data is a JSON array containing three objects: 1. **obj**: An object with properties numbered 141 to 199, all set to `true`. 2. **data**: The same object as `obj`. 3. **arr**: An empty array that will be populated with numbers from 1 to 200. **Benchmark Test Cases** The benchmark test cases are two objects: 1. **Delete Object Property**: Deletes each property in the `obj` object using a `for...in` loop. 2. **Spread Object**: Spreads the properties of the `obj` object into a new array using destructuring assignment. 3. **Filter Array**: Filters out the numbers 141 to 199 from the `arr` array. **Latest Benchmark Results** The latest benchmark results are an array of three objects: 1. **Filter Array**: A Chrome browser result with 7,384,281 executions per second on a Mac OS X 10.15.7 desktop. 2. **Delete Object Property**: A Chrome browser result with 7,265,421 executions per second on a Mac OS X 10.15.7 desktop. 3. **Spread Object**: A Chrome browser result with 6,990,074 executions per second on a Mac OS X 10.15.7 desktop. Based on these results, we can see that the `Filter Array` benchmark is performing better than the other two benchmarks. If you'd like to discuss further or ask specific questions about the data, I'm here to help!
Related benchmarks:
Remove item from array
spread v splice
ISO 8601 parsing
delete object property vs spread
Comments
Confirm delete:
Do you really want to delete benchmark?