Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
intersect v3bc
(version: 0)
Comparing performance of:
a vs b vs c
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
Array.prototype.shuffle = function() { let m = this.length, i; while (m) { i = (Math.random() * m--) >>> 0; [this[m], this[i]] = [this[i], this[m]] } return this; }; var watched = []; for(let i = 0; i < 100000; i++){watched.push({programId:Math.random()});} var ignored = [...watched]; ignored.shuffle(); ignored = ignored.slice(50000, 51000);
Tests:
a
watched.filter(wObj => { return !ignored.some((iObj, ndx) => { return iObj.programId === wObj.programId; }); });
b
watched.filter(wObj => !ignored.some((iObj, ndx) => { if (iObj.programId === wObj.programId) { ignored[ndx].programId = ignored.pop().programId; return true; } return false; }) );
c
var iset = new Set(ignored.flatMap(obj => obj.parentId)); watched.filter(wObj => !iset.has(wObj.parentId));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
a
b
c
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!
Comments
Confirm delete:
Do you really want to delete benchmark?