NEW July 13. 2021! Uploaded multithreaded variant of 1 bit per prime candidate. Performance: AMD TR 1950x 32 bit: 85000+ passes, 64 bit: 129200+ passes
NEW July 4. 2021! Reuploaded 1 bit per prime candidate 64 bit optimized solution (Project2), which performs more than twice as fast as the 32 bit solution.
David Plummer, previously working for years with Microsoft programming various sorts of features, like the Task Manager, the Space Cadet Pin Ball game, SmartCache and more, has started a contest, trying to figure out which programming language is the “fastest”.
Obviously “fastest” can mean many things, but in this contest, it means how many times can an application compiled or run by one of 45+ different compilers/interpreters find all prime numbers between 2 and 1 million within 10 seconds.
Delphi is represented as one of the 45+ environments, and today he released a comparison between Delphi, Pascal (in the form of FreePascal and ADA which syntax wise looks similar to Pascal. For various reasons Delphi is actually not benchmarked (I know Jim McKeeth is working on a solution for them to include Delphi… licensing etc. stuff).
You can follow him at Daves Garage on Youtube here: https://www.youtube.com/c/DavesGarage/playlists
The latest (and first of several) video is here: https://www.youtube.com/watch?v=tQtFdsEcK_s&list=PLF2KJ6Gy3cZ5Er-1eF9fN1Hgw_xkoD9V1&index=6&ab_channel=Dave%27sGarage
The code being used in the benchmark can be found at GitHub here: https://github.com/PlummersSoftwareLLC/Primes
Delphi is as said represented with a solution, but I could not help myself, than try to produce an optimized version.
In fact I made a couple, one based on the same 1 byte per 1 prime candidate as the original solution, and one which use only 1 bit per 1 prime candidate (as the contest actually require).
I have uploaded both to GitHub as candidates, but my pull requests has to be accepted before they will show up in the main tree.
For that reason I have also made them available for others to play with (and perhaps optimize further) on Google Drive here: https://drive.google.com/drive/folders/1ljI4AlaL7WUfmTNeUoEfzWZFwVcImZL6?usp=sharing
It contains two Delphi files, Project1.dpr and Project2.dpr.
Project1.dpr use 1 byte per 1 prime candidate, but runs approximately 100% faster than the original.
Project2.dpr use 1 bit per 1 prime candidate, but runs approximately 10% faster than the original.
Follow the project and do what you can to provide faster prime generators to make Delphi shine 🙂