Forum > Other
Benchmarks fpc vs gcc.
(1/1)
Fred vS:
Hello.
Somebody sent me this link:
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/fpascal-gpp.html
What do you think?
Pertinent?
Fre;D
marcov:
Why don't you search for the benchmarks game here on the forum? IIRC the maintainer (IGouy) is/was even member of the forum.
My short opinions: short one file benchmarks are one sided. Also the format of the benchmark games is so that.
About the memory and startup differences see e.g. https://stackoverflow.com/questions/11225580/does-freepascal-really-use-far-less-memory-than-gcc/11251397#11251397 . Some of the benchmarking is just a matter of different (RTL/linking preferences) defaults.
Fred vS:
--- Quote from: marcov on October 29, 2022, 02:40:07 pm ---Why don't you search for the benchmarks game here on the forum? IIRC the maintainer (IGouy) is/was even member of the forum.
My short opinions: short one file benchmarks are one sided. Also the format of the benchmark games is so that.
About the memory and startup differences see e.g. https://stackoverflow.com/questions/11225580/does-freepascal-really-use-far-less-memory-than-gcc/11251397#11251397 . Some of the benchmarking is just a matter of different (RTL/linking preferences) defaults.
--- End quote ---
Perfect.
( And it seems that, once again, when libc is not used, all goes faster/better, .. okay, okay, I'm leaving )
Thanks Marcov. ;)
abouchez:
What is not obvious in this well-known "benchmark game" is that coders are allowed to use low-level tricks to make the code as fast as possible.
It was meant to display the fastest possible way of each language/framework.
Some experts of each language are indeed involved into tuning the code.
As a result, some of the code is highly optimized, but also really complicated/unreadable.
To be realistic and fair, no one write such code for a regular project, unless it is part of a library or a very sensitive core business (like finance or a game).
IMHO this "benchmark game" does not compare languages for their day-to-day usage.
I would never draw any conclusion from this "benchmark game" to pickup one language over another.
C almost always win. If you need something really fast, rewrite the sensitive part in C, then call it from your own language.
To compare solutions, I prefer something more simple, and more realistic, which tries to use the built-in language features.
The simple challenge we discussed about at https://forum.lazarus.freepascal.org/index.php/topic,61035.0.html is more likely to be useful for discussion.
It compares languages and libraries about a simple but realistic use case: returning some JSON from CSV data read into memory, in a REST/HTTP server.
It has no C/C++ version yet, because it targeted high-level "modern" languages.
My guess is that with some modern C/C++ libraries, you may reach very high performance.
We added two pascal versions to the challenge.
Some thought about it at https://blog.synopse.info/?post/2022/11/26/Modern-Pascal-is-Still-in-the-Race
In short: if someone says pascal is old/deprecated/slow, then it is clearly not.
You can write expressive and efficient code with pascal, with no highly complicated/unreadable code.
For this use case, the pascal server produces more than 900MB/s of results, so much more than any network interface is able to serve today. ;)
Feel free to redirect my blog link to the "somebody" who sent you the benchmark games link.
Leledumbo:
Well it's not hard to see the page nowadays shows all submissions instead of just the best, and more often than not, g++ is both the best and worst, showing who coded it matters more than what language / compiler the solution is coded in.
Navigation
[0] Message Index