Skip to content

Commit

Permalink
Improve D solution 2
Browse files Browse the repository at this point in the history
  • Loading branch information
BradleyChatha committed Jul 14, 2021
1 parent 5faa16c commit 2c7bbf9
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 69 deletions.
22 changes: 16 additions & 6 deletions PrimeD/solution_2/README.md
@@ -1,7 +1,8 @@
# D solution by BradleyChatha
# D solution by Bradley Chatha, Paul Backus, Bastiaan Veelo

![Algorithm](https://img.shields.io/badge/Algorithm-base-green)
![Faithfulness](https://img.shields.io/badge/Faithful-yes-green)
![Faithfulness](https://img.shields.io/badge/Faithful-no-yellowgreen)
![Parallelism](https://img.shields.io/badge/Parallel-no-green)
![Parallelism](https://img.shields.io/badge/Parallel-yes-green)
![Bit count](https://img.shields.io/badge/Bits-1-green)
Expand All @@ -10,6 +11,11 @@ A faithful yet more idiomatic and memory efficient (bits 1) implementation than

This implementation is well commented on the D specific parts.

It includes an unfaithful version (due to certain things not being runtime values) and a faithful version. Both are ran in a single threaded and then
multi-threaded test.

If you're not familiar with some of the antics D can achieve... have fun with the code.

## Run instructions

### Without Docker
Expand Down Expand Up @@ -39,9 +45,13 @@ Windows 10 Build 19041 | i5-7600K @ 3.80 GHz

```
<command> dub run -b release --compiler=ldc2
<stderr> Passes: 6936, Time: 5 secs, 1 ms, 505 ╬╝s, and 9 hnsecs, Avg: 721 ╬╝s, Limit: 1000000, Count: 78498, Valid: false
<stderr> Passes: 17101, Time: 5 secs, 169 ╬╝s, and 3 hnsecs, Avg: 292 ╬╝s and 3 hnsecs, Limit: 1000000, Count: 78498, Valid: false
BradleyChatha;6936;5.00151;1;algorithm=base,faithful=yes,bits=1
BradleyChatha-Multi;17101;5.00017;4;algorithm=base,faithful=yes,bits=1
<stderr> Passes: 7620, Time: 5 secs, 487 μs, and 6 hnsecs, Avg: 656 μs and 2 hnsecs, Limit: 1000000, Count: 78498, Valid: true
<stderr> Passes: 24501, Time: 5 secs, 98 μs, and 9 hnsecs, Avg: 204 μs, Limit: 1000000, Count: 78498, Valid: true
<stderr> Passes: 7523, Time: 5 secs, 42 μs, and 9 hnsecs, Avg: 664 μs and 6 hnsecs, Limit: 1000000, Count: 78498, Valid: true
<stderr> Passes: 12349, Time: 5 secs, 1 ms, 12 μs, and 8 hnsecs, Avg: 404 μs and 9 hnsecs, Limit: 1000000, Count: 78498, Valid: true
BradleyChatha-Single-SieveCT;7620;5.00049;1;algorithm=base,bits=1,faithful=no
BradleyChatha-Multi-SieveCT;24501;5.0001;4;algorithm=base,bits=1,faithful=no
BradleyChatha-Single-SieveRT;7523;5.00004;1;algorithm=base,bits=1,faithful=yes
BradleyChatha-Multi-SieveRT;12349;5.00101;4;algorithm=base,bits=1,faithful=yes
```

0 comments on commit 2c7bbf9

Please sign in to comment.