Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
findIndex vs findIndex + filter
(version: 0)
Comparing performance of:
Case with filter vs Case without fileter
Created:
3 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var orderedProducts = [ { "id": 100758, "name": "Sód i potas w moczu", "code": "293" }, { "id": 665352, "name": "Biocenoza pochwy", "code": "132" }, { "id": 100879, "name": "Ceruloplazmina", "code": "257" },{ "id": 100822, "name": "Bilirubina całkowita", "code": "23" }, { "id": 717442, "name": "Bilirubina met. ISE", "code": "3416" }, { "id": 9625366, "name": "Bilirubina noworodkowa", "code": "47" }, { "id": 100865, "name": "Bilirubina wolna (pośrednia)", "code": "25" }, { "id": 100821, "name": "Bilirubina związana (bezpośrednia)", "code": "24" }, { "id": 672429, "name": "Weryfikacja - bilirubina w moczu", "code": "3502" }, { "id": 27548724, "name": "e-PAKIET DLA KOBIET", "code": "7206", tests: [ { "id": 100610, "name": "OB", "code": "2" }, { "id": 100641, "name": "Morfologia krwi (pełna)", "code": "3" }, { "id": 100653, "name": "GGTP", "code": "26" }, { "id": 100655, "name": "Kreatynina", "code": "33" }, { "id": 100658, "name": "Glukoza", "code": "10" }, { "id": 100666, "name": "ALT special badanie o maksymalnej replikowanej nazwie badania 200 znakow ALT special badanie o maksymalnej replikowanej nazwie badania 200 znakow ALT special badanie o maksymalnej", "code": "20" }, { "id": 100674, "name": "TSH special : badanie o maksymalnej replikowanej nazwie badania 100 znaków w obecnej wersji systemu ?", "code": "100" }, { "id": 100918, "name": "Wapń całkowity", "code": "42" }, { "id": 100919, "name": "Magnez", "code": "46" }, ] }, { "id": 27548111, "name": "e-PAKIET DLA CHŁOPA", "code": "7206", tests: [ { "id": 100740, "name": "Mocznik", "code": "32" }, { "id": 100786, "name": "CRP, ilościowo", "code": "61" }, { "id": 100814, "name": "CA 15-3", "code": "207" }, { "id": 100893, "name": "Estradiol", "code": "112" }, { "id": 100904, "name": "CA 125", "code": "206" }, { "id": 100914, "name": "Lipidogram (CHOL, HDL, nie-HDL, LDL, TG)", "code": "14" }, { "id": 100915, "name": "Kwas moczowy", "code": "36" }, { "id": 100918, "name": "Wapń całkowity", "code": "42" }, { "id": 100919, "name": "Magnez", "code": "46" }, { "id": 100920, "name": "Fosfor nieorganiczny", "code": "45" }, { "id": 457540, "name": "Witamina D metabolit 25(OH)", "code": "168" }, { "id": 457752, "name": "Osteokalcyna", "code": "162" }, { "id": 588687, "name": "Elektrolity (Na, K)", "code": "11" } ] }, { "id": 99999999, "name": "Dupliakt pakietu", "code": "7206", tests: [ { "id": 100740, "name": "Mocznik", "code": "32" },{ "id": 100786, "name": "CRP, ilościowo", "code": "61" },{ "id": 100918, "name": "Wapń całkowity", "code": "42" },{ "id": 100919, "name": "Magnez", "code": "46" }, ] } ];
Tests:
Case with filter
const filtered = orderedProducts.filter((product) => product.tests); const isInPackage = filtered?.findIndex((porduct) => { return porduct.tests?.findIndex((test) => test.id === 100666); });
Case without fileter
const isInPackage = orderedProducts?.findIndex((porduct) => { return porduct.tests?.findIndex((test) => test.id === 100666); });
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Case with filter
Case without fileter
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 do my best to help! It appears that the provided text is in JSON format, but it's not a single object or array. Instead, it seems to be two separate objects, one for "Individual test cases" and another for "Latest benchmark result". If I were to parse this data, I would expect something like this: ```json { "individualTestCases": [ { "benchmarkDefinition": "...", "testName": "...", "rawUAString": "...", "browser": "...", "devicePlatform": "...", "operatingSystem": "...", "executionsPerSecond": "...", "testName": "..." } ], "latestBenchmarkResult": [ { "benchmarkDefinition": "...", "rawUAString": "...", "browser": "...", "devicePlatform": "...", "operatingSystem": "...", "executionsPerSecond": "...", "testName": "..." } ] } ``` However, please note that the structure of this data is not clear-cut and may require further processing to make sense. If you could provide more context or clarify what these objects are supposed to represent, I'd be happy to try and help further!
Related benchmarks:
Remove array object, findIndex and splice vs filter
indextToRemove & splice vs find vs object key undefined vs object key delete
JS Array IndexOf vs includes vs findIndex vs find 5
JS Find vs FindIndex vs Filter
JS Array IndexOf vs includes vs findIndex vs find1
Comments
Confirm delete:
Do you really want to delete benchmark?