Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
3ad12dzfa
(version: 0)
a321
Comparing performance of:
1 vs 2
Created:
3 years ago
by:
Guest
Jump to the latest result
Tests:
1
function gap(g, m, n) { const iters = Array(n+1-m).fill().map((_, i) => i+m).filter(isPrime) const index = iters.findIndex((e,i) => iters[i+1] - e == g) return index !== -1 ? [iters[index], iters[index + 1]] : null } const isPrime = n => Array.from({length: Math.ceil(Math.sqrt(n)+1)}, (_, i) => i).slice(2).every(d => n % d) gap(2, 100, 2000)
2
function gap(g, m, n) { const iters = Array({length:n+1-m}, (_, i) => i+m).filter(isPrime) const index = iters.findIndex((e,i) => iters[i+1] - e == g) return index !== -1 ? [iters[index], iters[index + 1]] : null } const isPrime = n => Array.from({length: Math.ceil(Math.sqrt(n)+1)}, (_, i) => i).slice(2).every(d => n % d) gap(2, 100, 2000)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
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!
Related benchmarks:
Quick topology clone perf test
ToKebabCase3
IndexOf vs Includes vs lodash includes LARGE
Asterisk character test
Lodash partition vs ES6 (KAP
Comments
Confirm delete:
Do you really want to delete benchmark?