09-06-2022, 03:33 PM
Comparison QB64 compiled with gcc optimizations and without
|
i found this code here :
https://github.com/nsiatras/programming-...-benchmark Code: (Select All) Dim fCount As Integer compiled with Freebasic -gen gas64 Free Basic Matrix Multiplication Benchmark finished in: 63.6x seconds executable size : 65,4 Kio compiled with Freebasic -gen gcc -Wc -Os Free Basic Matrix Multiplication Benchmark finished in: 40.0x seconds executable size : 65,3 Kio compiled with Freebasic -gen gcc -Wc -O3 Free Basic Matrix Multiplication Benchmark finished in: 39.8x seconds executable size : 65,3 Kio --- I tested the source code in C and in freepascal. results : C optimization -Os Matrix Multiplication Benchmark finished in 15.744985 seconds executable size : 16,6 Kio C without optimization Matrix Multiplication Benchmark finished in 71.999291 seconds executable size : 16,6 Kio FreePascal activation optimization -O2 Matrix Multiplication Benchmark finished in: 44.972 seconds executable size : 547,9 Kio FreePascal without optimization FreePascal Matrix Multiplication Benchmark finished in: 56.339 seconds executable size : 547,9 Kio --- compiled with qb64pe v3.1.0 original 144.2x seconds - executable size : 1016,8 Kio compiled with qb64pe v3.1.0 -Os 64.0x seconds - executable size : 727,7 Kio compiled with qb64pe v3.1.0 -O3 56.4x seconds - executable size : 947,7 Kio the code generated by freebasic is more efficient than qb64pe. that's why the speed difference is so big. i noticed it before when testing console programs. freebasic programs are clearly faster, lighter and compile extremely fast. qb64pe keeps the advantage of the built-in editor, the syntax is easier and the code writing is faster. but the most important advantage of qb64pe is the license which is totally free without any restriction. the maintainers continue with version 3.1.0 to improve this point.
my times
compiled with Freebasic -gen gcc -Wc -Os Free Basic Matrix Multiplication Benchmark finished in: 11 seconds compiled with qb64pe v3.1.0 -Os 45 seconds Coolman, what CPU do you have, Intel or AMD? mine is Intel
09-12-2022, 02:02 PM
(09-12-2022, 01:31 PM)Jack Wrote: my times thanks for providing another point of comparison. you have a much faster computer than mine. i was going to ask you the same question. i have a laptop with an i7-8550U processor. what processor do you have?
09-12-2022, 02:17 PM
my CPU is an Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz, 3600 Mhz, 8 Core(s), 16 Logical Processor(s)
however, the CPU speed varies depending on load, it throttles up and down all the time usually between 800 and 5000 MHz
09-12-2022, 02:31 PM
you have an excellent processor. the results should be better. under linux there are utilities to block the processor frequency to the maximum temporarily. i haven't tried it because i use a laptop but on a desktop it would be interesting to see when testing.
09-12-2022, 03:35 PM
there's no need to lock the speed, whenever I run a CPU intensive program it speeds up to 5GHz and remains at that speed until the program ends, locking the speed at 5GHz would severely shorten it's life
09-20-2022, 05:01 PM
I have some free time. I have added the test of the C and freepascal source code located here :
https://github.com/nsiatras/programming-...-benchmark if anyone is interested. see here : https://qb64phoenix.com/forum/showthread...35#pid6535 |
« Next Oldest | Next Newest »
|
Users browsing this thread: 9 Guest(s)