jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Project Euler Problem #1
http://projecteuler.net/index.php?section=problems&id=1
states:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
We can:
What's the fastest solution?
<script>
var a = 3,
b = 5,
n, max = 1000,
sum = 0;
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Use object as set to avoid duplicates | | ready |
| Add all multiples, then subtract multiples in common | | ready |
| Shorter | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.