Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
test vs match v2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Browser:
Firefox 115
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
test
1917495.6 Ops/sec
match
1491512.5 Ops/sec
Script Preparation code:
var text = ` Flow exporter exporter-ipf: Exporter ddb node id: 0x5400100 Description: LAB Destination: 10.0.10.20 VRF: default (1) Destination UDP Port 9995 Source Interface loopback0 (10.241.255.6) Export Version 5 Exporter Statistics Number of Flow Records Exported 0 Number of Export Packets Sent 0 Number of Export Bytes Sent 0 Number of Destination Unreachable Events 0 Number of No Buffer Events 0 Number of Packets Dropped (No Route to Host) 0 Number of Packets Dropped (other) 0 Number of Packets Dropped (LC to RP Error) 0 Number of Packets Dropped (Output Drops) 0 Time statistics were last cleared: Never `; var regex = /^\s*Destination\s(UDP|SCTP)\sPort\s(\d+)/; var rows = text.split(/\n/);
Tests:
test
var out = rows.reduce((acc, row) => { if (regex.test(row)) { acc.push(row.match(regex)); } else { return acc } }, []);
match
var out = rows.reduce((acc, row) => { var result = row.match(regex) if (result) { acc.push(result); } else { return acc } }, []);