PlummersSoftwareLLC / Primes

Prime Number Projects in C#/C++/Python
https://plummerssoftwarellc.github.io/PrimeView/
2.43k stars 574 forks source link

Pascal Parameters can use const word to be fastest #967

Closed Mat-Hac closed 1 month ago

Mat-Hac commented 1 month ago

Hello !

I am a Lazarus programer. I do not know which program you use to test pascal. But Free Pascal 3.3.1 is the best because written in assembly and last version.

Before a parameter you can use const word to get faster. const word does not copy the variable of parameter.

Tell Me !

rbergen commented 1 month ago

First off, I will be converting this Issue to an Idea discussion after I write this comment, because I think it's the latter much more than the former.

As the source code for all solutions is included in this repository, it's not a secret what Pascal compiler/runtime we use. I haven't checked all Pascal solutions just now, but I actually authored the first Pascal solution myself, and I know for sure that one indeed does use Free Pascal - although which exact version I don't remember.

If you think it's possible to improve the performance of one or multiple of the solutions that are in this repository after you've read the code, then you are not just free but actually encouraged to open a PR to apply whatever code changes are necessary to get the better performance. Of course, it is appreciated if you indeed confirm that your version of the solution(s) in question do perform better than the current ones before you do so.