Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

readme-ing it up

  • Loading branch information...
commit 3608ab8b90f53f27d301bb69b49bfb9bbf90f06c 1 parent e03d312
@regality authored
Showing with 13 additions and 3 deletions.
  1. +10 −0 README.md
  2. +3 −3 test.js
View
10 README.md
@@ -19,3 +19,13 @@ var primes = sieve(1000000);
// primes from 100 to 1000000
var primes = sieve(1000000, 100);
```
+
+The sieve returns a Uint32Array, unless you are using a shitty browser,
+in which case you just get an ordinary array.
+
+## Perfomance
+
+On my macbook pro, it found all primes from 2 to 100,000,000 in 2723ms.
+
+It has memory issues with arrays much larger than that. If that is a
+problem, submit a pull request.
View
6 test.js
@@ -1,11 +1,11 @@
-var numberSeive = require('./seive')
- , n = 10000000
+var numberSieve = require('./sieve')
+ , n = 100000000
;
console.log('generating primes...');
console.time('primes generated in');
-var primes = numberSeive(n);
+var primes = numberSieve(n);
console.timeEnd('primes generated in');
console.log('found ' + primes.length + ' primes');
Please sign in to comment.
Something went wrong with that request. Please try again.