Comments (4)
Considerations for a solution
Ok I don't really have a solution, but here are some of my considerations:
- Constructs and optimizations that a language provides are fine and wanted (for example using iterators / filters in rust instead of the normal for loops, or C++ vector find) since those represent the languages features
- The base algorithm should have to be the same if any cross language comparison is wanted (outer loop, find next factor, set values for this factor, increment factor)
- The factor checking HAS to start with 3 and not 5, 7, or even higher to stay comparable
- The way how the smaller tasks in the algorithm, like setting / clearing or storing the values can be changed as needed
Well this would exactly be my understanding of the rules in CONTRIBUTING.md. If an implementation wants to be base, it has to use the algorithm as in the original solution and it has to start checking at 3. If it want's to be faithful it also has to stick to some memory management rules.
So a comparison of results using base and being faithful should still be valid I think.
from primes.
So a comparison of results using base and being faithful should still be valid I think.
On top of that, Dave's leaderboard will only include solutions that use 1 bit per prime candidate.
from primes.
I think what's considered faithful and what not is a bit of a nitpick when it comes to some details.
The space for the storage for example can be halfed without changing the algorithm itself and goes in line with the inc by 2 loop. When even numbers are not even counted except 2 then why put them into the sieve at all.
Also the fact that vector<bool>
is implemented as bitpacked storage and the C++ compilers know about that is an implementation detail and should not force other implementations to do the same - whether this fact even matters highly depends on your L1 cache size and the bit-twiddling can even be detrimental for performance.
from primes.
This is also my response to your comment on #398: the rules are indeed somewhat arbitrary. They're based on a) the 3 implementations that started this project, and b) what Dave has explicitly indicated is important to him (bit twiddling is one of them). They've been in place for a while now, and they've served us to the point that there are now well over 100 implementations in 53 languages in this repo dealing with them.
from primes.
Related Issues (20)
- Suddenly a solution build fails HOT 1
- Most languages fail building HOT 7
- Multi-threading reporting question
- Fix all dockerlint warnings/info's?
- I may have increased the Delphi performance by 45% HOT 1
- Handling Legal Questions re: Dyalog APL HOT 8
- PrimesV/solution_2 does not build HOT 1
- Bad access on CPP Solution3 with clang (macOS ARM64) HOT 3
- Number of threads isn't being reported by awk solution 1 HOT 4
- primeJava/solution_4 showing about 10 seconds of run time on core2 duo HOT 4
- Dart/solution_1 hangs on 5950X runner HOT 5
- need a command to compile without running
- All Benchmarks Fail to Compile HOT 9
- I have a coldfusion solution
- Rust solution 1 takes 10 seconds instead of just 5 HOT 1
- PrimeJava counting small numbers as prime HOT 3
- would have been nice to include a list of the results for those who don't have the time to set this up. HOT 1
- Ruby solution takes > 4 hours to complete. HOT 9
- Question: Is inline assembly allowed?
- Thoughts on Prime Number Generation Challenge and a Possible Spin-Off HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from primes.