|
3 | 3 | 
|
4 | 4 | 
|
5 | 5 | 
|
6 |
| - |
| 6 | + |
7 | 7 |
|
8 | 8 | My implementation uses the Perl Data Language (PDL) to mark all multiples of
|
9 | 9 | a prime with a single instruction. PDL is a package that extends Perl,
|
@@ -37,27 +37,27 @@ docker run --rm primes
|
37 | 37 | ## Output
|
38 | 38 |
|
39 | 39 | ```
|
40 |
| -Luis_Mochán_(wlmb)_Perl/PDL;440;5.002161;1;algorithm=base,faithful=yes |
41 |
| -Luis_Mochán_(wlmb)_Perl/PDL;459;5.006921;1;algorithm=base,faithful=yes |
42 |
| -Luis_Mochán_(wlmb)_Perl/PDL;461;5.009201;1;algorithm=base,faithful=yes |
43 |
| -Luis_Mochán_(wlmb)_Perl/PDL;456;5.007696;1;algorithm=base,faithful=yes |
44 |
| -Luis_Mochán_(wlmb)_Perl/PDL;463;5.000091;1;algorithm=base,faithful=yes |
| 40 | +Luis_Mochán_(wlmb)_Perl/PDL;726;5.001482;1;algorithm=base,faithful=yes,bits=8 |
| 41 | +Luis_Mochán_(wlmb)_Perl/PDL;723;5.002705;1;algorithm=base,faithful=yes,bits=8 |
| 42 | +Luis_Mochán_(wlmb)_Perl/PDL;721;5.003962;1;algorithm=base,faithful=yes,bits=8 |
| 43 | +Luis_Mochán_(wlmb)_Perl/PDL;731;5.004047;1;algorithm=base,faithful=yes,bits=8 |
| 44 | +Luis_Mochán_(wlmb)_Perl/PDL;714;5.005479;1;algorithm=base,faithful=yes,bits=8 |
45 | 45 | ```
|
46 | 46 |
|
47 | 47 | ### Benchmarks
|
48 | 48 |
|
49 |
| -In my laptop it's about an order of magnitude faster than Perl's |
| 49 | +In my laptop it's about twenty times faster than Perl's |
50 | 50 | solution 1. I did use external modules, but they are general purpose
|
51 | 51 | language extensions, not targeted to this problem.
|
52 | 52 |
|
53 | 53 | On my Dell Latitude E7450, I get the following numbers:
|
54 | 54 |
|
55 | 55 | ```
|
56 |
| -Passes: 459, Time: 5.00613212585449, Per pass: 0.0109066059386808 Limit: 1000000 Count: 78498 Valid: 1 |
57 |
| -Passes: 442, Time: 5.00916695594788, Per pass: 0.0113329569139092 Limit: 1000000 Count: 78498 Valid: 1 |
58 |
| -Passes: 441, Time: 5.00524806976318, Per pass: 0.0113497688656762 Limit: 1000000 Count: 78498 Valid: 1 |
59 |
| -Passes: 456, Time: 5.00585103034973, Per pass: 0.0109777434876091 Limit: 1000000 Count: 78498 Valid: 1 |
60 |
| -Passes: 448, Time: 5.00958800315857, Per pass: 0.0111821160784789 Limit: 1000000 Count: 78498 Valid: 1 |
| 56 | +Passes: 726, Time: 5.0014820098877, Per pass: 0.00688909367753126 Limit: 1000000 Count: 78498 Valid: 1 |
| 57 | +Passes: 723, Time: 5.00270485877991, Per pass: 0.00691937048240651 Limit: 1000000 Count: 78498 Valid: 1 |
| 58 | +Passes: 721, Time: 5.00396203994751, Per pass: 0.00694030796109225 Limit: 1000000 Count: 78498 Valid: 1 |
| 59 | +Passes: 731, Time: 5.00404691696167, Per pass: 0.00684548141855222 Limit: 1000000 Count: 78498 Valid: 1 |
| 60 | +Passes: 714, Time: 5.00547909736633, Per pass: 0.00701047492628338 Limit: 1000000 Count: 78498 Valid: 1 |
61 | 61 | ```
|
62 | 62 |
|
63 | 63 | ## Author
|
|
0 commit comments