tycho/genprime — pull request #2 by eddieringle (2014-06-08 16:51:37+00:00)
Title: Compile genprime-swift with -O3

Didn't realize the C-family implementations were being compiled with -O3. I added this for Swift as well and the results changed quite dramatically.

Benchmarks:

```
ganglion:genprime eddie$ ./genprime-swift 50000 500000
Found 50000 primes in 0.159726 seconds (last was 611953)
Found 100000 primes in 0.450983 seconds (last was 1299709)
Found 150000 primes in 0.835602 seconds (last was 2015177)
Found 200000 primes in 1.291085 seconds (last was 2750159)
Found 250000 primes in 1.821854 seconds (last was 3497861)
Found 300000 primes in 2.392536 seconds (last was 4256233)
Found 350000 primes in 3.027330 seconds (last was 5023307)
Found 400000 primes in 3.712356 seconds (last was 5800079)
Found 450000 primes in 4.445630 seconds (last was 6581963)
Found 500000 primes in 5.264614 seconds (last was 7368787)
```

```
ganglion:genprime eddie$ ./genprime-c 50000 500000
Found 50000 primes in 0.162000 seconds (last was 611953)
Found 100000 primes in 0.440510 seconds (last was 1299709)
Found 150000 primes in 0.803440 seconds (last was 2015177)
Found 200000 primes in 1.243230 seconds (last was 2750159)
Found 250000 primes in 1.744320 seconds (last was 3497861)
Found 300000 primes in 2.298760 seconds (last was 4256233)
Found 350000 primes in 2.904560 seconds (last was 5023307)
Found 400000 primes in 3.585480 seconds (last was 5800079)
Found 450000 primes in 4.271710 seconds (last was 6581963)
Found 500000 primes in 5.017150 seconds (last was 7368787)
```

Also, a binary size comparison between Swift and C (both compiled with -O3):

```
ganglion:genprime eddie$ ls -al genprime-{swift,c}
-rwxr-xr-x 1 eddie staff 8720 Jun 4 16:31 genprime-c
-rwxr-xr-x 1 eddie staff 162520 Jun 8 12:40 genprime-swift
```

For completeness, Swift's binary size compiled without -O3:

```
ganglion:genprime eddie$ ls -al genprime-swift
-rwxr-xr-x 1 eddie staff 50736 Jun 4 16:32 genprime-swift
```

Signed-off-by: Eddie Ringle