Speed of FreeBasic

For other topics related to the FreeBASIC project or its community.
caseih
Posts: 1318
Joined: Feb 26, 2007 5:32

Re: Speed of FreeBasic

Interesting little benchmark but we have to be careful lest we're benchmarking the wrong thing. In FB at least you're really benchmarking string creation, which is going to have overhead. Thus I'm not even sure you're actually comparing equivalent things across languages. For example all compiled languages should probably be about the same. I'm skeptical that Swift, for example, is an order of magnitude slower than C++ or FB.

I note that everything being done in this program can be done with only integers and no big slow SELECT CASE statements which dramatically changes the benchmark. On my machine, FB 1.05 64-bit Linux it ran in 14.97 seconds, but after I optimized your program to remove all use of string types, it ran in 0.5 seconds.

Code: Select all

`dim as integer p = 0dim as integer x=-1dim as integer a1,a2,a3dim as integer ps1,ps2,ps3dim as integer h1,h2,h3dim as integer hh1=asc("L") - 65h2=asc("W") - 65h3=asc("K") - 65h=3724do    x+=1    p+=1    if x>9999 then        x=0        a3+=1        if a3>25 then            a3=0            a2+=1            if a2>25 then                a2=0                a1+=1            end if        end if    end if    ps1 = a1    ps2 = a2    ps3 = a3loop until h1=ps1 and h2=ps2 and h3=ps3 and h=xprint chr(ps1+65)print chr(ps2+65)print chr(ps3+65)print xprint "Location: ";pend`

Python runs at a respectable 40 seconds on my machine now, which is pretty good considering this benchmark is brute-force searching and thus incurs the full cost of the interpreter doing all the flow control. What is needed here is a better algorithm. I haven't analyzed the Big-O of this little routine, but at first glance it strikes me as being O(n^3). If it could be reduced to n Log n, then a scripting language might be respectable at it.
Ed Davis
Posts: 10
Joined: Jul 28, 2008 23:24

Re: Speed of FreeBasic

zxretrosoft wrote:Hi friends,
You might be interested.
I made a simple algorithm, intentionally brute force with CASE.
...

Interesting. I did my own integer-intensive benchmarks a while back. See here: https://www.freebasic.net/forum/viewtopic.php?f=17&t=23489

For your test, I get very different results on my machine: Intel Core i7-6820HQ CPU @2.70GHz, 16 GB ram, Windows 7 64-bit. Plus, it is hard for me to understand how Go, Java and C# are faster than C++, on this benchmark at least. Please post your Go, Java, C#, C++, Javascript and Python versions. I'd like to test those on my machine.

(Update: based on what caseih, said, I think I understand better now, why the C++ version might have been so slow. My C versions "cheat", since they use characters, not strings. And since C doesn't have strings, I guess one can't really do this benchmark in C, unless you resort to strcpy() and friends.)

Note: in c, you can't switch on floats, so I did switch ((int)a1), etc., and then a 2nd benchmark using if's, without the cast.
• C using switch and cast: gcc -Ofast: 0.86 seconds
• C using nested ifs, no cast: gcc -Ofast: 1.43 seconds
• QB64 v1.1: qb64 -x: 15.88 seconds
• FB 1.05 32-bit, compiled with: fbc -w all -gen gas -fpu sse -O 3: 16.65 seconds
• FB 1.05 32-bit, compiled with: plain fbc, no options: 16.76 seconds
• FB 1.05 32-bit, compiled with: fbc -w all -gen gcc -fpu sse -Wc -O3: 17.09 seconds

Note that all these print out the same results: L W K 3724 80183725

Very strange that QB64 is a tad bit faster than FreeBasic. First time I've seen that.

For reference, below are my two C versions:

C code using casts and switch:

Code: Select all

`#include <stdio.h>int main() {    double p;    float x=-1;    float a1,a2,a3;    char ps1,ps2,ps3;    char h1,h2,h3;    float h;    p = 0;          /* need to init these for C */    a1=a2=a3=h=0;   /* need to init these for C */    h1='L';    h2='W';    h3='K';    h=3724;    for (;;) {        x+=1;        p+=1;        if (x>9999) {            x=0;            a3+=1;            if (a3>25) {                a3=0;                a2+=1;                if (a2>25) {                    a2=0;                    a1+=1;                }            }        }        switch ((int)a1) {            case 0:  ps1='A'; break;            case 1:  ps1='B'; break;            case 2:  ps1='C'; break;            case 3:  ps1='D'; break;            case 4:  ps1='E'; break;            case 5:  ps1='F'; break;            case 6:  ps1='G'; break;            case 7:  ps1='H'; break;            case 8:  ps1='I'; break;            case 9:  ps1='J'; break;            case 10: ps1='K'; break;            case 11: ps1='L'; break;            case 12: ps1='M'; break;            case 13: ps1='N'; break;            case 14: ps1='O'; break;            case 15: ps1='P'; break;            case 16: ps1='Q'; break;            case 17: ps1='R'; break;            case 18: ps1='S'; break;            case 19: ps1='T'; break;            case 20: ps1='U'; break;            case 21: ps1='V'; break;            case 22: ps1='W'; break;            case 23: ps1='X'; break;            case 24: ps1='Y'; break;            case 25: ps1='Z'; break;        }        switch ((int)a2) {            case 0:  ps2='A'; break;            case 1:  ps2='B'; break;            case 2:  ps2='C'; break;            case 3:  ps2='D'; break;            case 4:  ps2='E'; break;            case 5:  ps2='F'; break;            case 6:  ps2='G'; break;            case 7:  ps2='H'; break;            case 8:  ps2='I'; break;            case 9:  ps2='J'; break;            case 10: ps2='K'; break;            case 11: ps2='L'; break;            case 12: ps2='M'; break;            case 13: ps2='N'; break;            case 14: ps2='O'; break;            case 15: ps2='P'; break;            case 16: ps2='Q'; break;            case 17: ps2='R'; break;            case 18: ps2='S'; break;            case 19: ps2='T'; break;            case 20: ps2='U'; break;            case 21: ps2='V'; break;            case 22: ps2='W'; break;            case 23: ps2='X'; break;            case 24: ps2='Y'; break;            case 25: ps2='Z'; break;        }        switch ((int)a3) {            case 0:  ps3='A'; break;            case 1:  ps3='B'; break;            case 2:  ps3='C'; break;            case 3:  ps3='D'; break;            case 4:  ps3='E'; break;            case 5:  ps3='F'; break;            case 6:  ps3='G'; break;            case 7:  ps3='H'; break;            case 8:  ps3='I'; break;            case 9:  ps3='J'; break;            case 10: ps3='K'; break;            case 11: ps3='L'; break;            case 12: ps3='M'; break;            case 13: ps3='N'; break;            case 14: ps3='O'; break;            case 15: ps3='P'; break;            case 16: ps3='Q'; break;            case 17: ps3='R'; break;            case 18: ps3='S'; break;            case 19: ps3='T'; break;            case 20: ps3='U'; break;            case 21: ps3='V'; break;            case 22: ps3='W'; break;            case 23: ps3='X'; break;            case 24: ps3='Y'; break;            case 25: ps3='Z'; break;        }        if (h1 == ps1 && h2 == ps2 && h3 == ps3 && h == x)            break;    }    printf("%c %c %c %f %f\n", ps1, ps2, ps3, x, p);    return 0;}`

C code using if's, no cast:

Code: Select all

`#include <stdio.h>int main() {    double p;    float x=-1;    float a1,a2,a3;    char ps1,ps2,ps3;    char h1,h2,h3;    float h;    p = 0;          /* need to init these for C */    a1=a2=a3=h=0;   /* need to init these for C */    h1='L';    h2='W';    h3='K';    h=3724;    for (;;) {        x+=1;        p+=1;        if (x>9999) {            x=0;            a3+=1;            if (a3>25) {                a3=0;                a2+=1;                if (a2>25) {                    a2=0;                    a1+=1;                }            }        }        if (a1 == 0)  ps1='A';        else if (a1 == 1)  ps1='B';        else if (a1 == 2)  ps1='C';        else if (a1 == 3)  ps1='D';        else if (a1 == 4)  ps1='E';        else if (a1 == 5)  ps1='F';        else if (a1 == 6)  ps1='G';        else if (a1 == 7)  ps1='H';        else if (a1 == 8)  ps1='I';        else if (a1 == 9)  ps1='J';        else if (a1 == 10) ps1='K';        else if (a1 == 11) ps1='L';        else if (a1 == 12) ps1='M';        else if (a1 == 13) ps1='N';        else if (a1 == 14) ps1='O';        else if (a1 == 15) ps1='P';        else if (a1 == 16) ps1='Q';        else if (a1 == 17) ps1='R';        else if (a1 == 18) ps1='S';        else if (a1 == 19) ps1='T';        else if (a1 == 20) ps1='U';        else if (a1 == 21) ps1='V';        else if (a1 == 22) ps1='W';        else if (a1 == 23) ps1='X';        else if (a1 == 24) ps1='Y';        else if (a1 == 25) ps1='Z';        if (a2 == 0)  ps2='A';        else if (a2 == 1)  ps2='B';        else if (a2 == 2)  ps2='C';        else if (a2 == 3)  ps2='D';        else if (a2 == 4)  ps2='E';        else if (a2 == 5)  ps2='F';        else if (a2 == 6)  ps2='G';        else if (a2 == 7)  ps2='H';        else if (a2 == 8)  ps2='I';        else if (a2 == 9)  ps2='J';        else if (a2 == 10) ps2='K';        else if (a2 == 11) ps2='L';        else if (a2 == 12) ps2='M';        else if (a2 == 13) ps2='N';        else if (a2 == 14) ps2='O';        else if (a2 == 15) ps2='P';        else if (a2 == 16) ps2='Q';        else if (a2 == 17) ps2='R';        else if (a2 == 18) ps2='S';        else if (a2 == 19) ps2='T';        else if (a2 == 20) ps2='U';        else if (a2 == 21) ps2='V';        else if (a2 == 22) ps2='W';        else if (a2 == 23) ps2='X';        else if (a2 == 24) ps2='Y';        else if (a2 == 25) ps2='Z';        if (a3 == 0)  ps3='A';        else if (a3 == 1)  ps3='B';        else if (a3 == 2)  ps3='C';        else if (a3 == 3)  ps3='D';        else if (a3 == 4)  ps3='E';        else if (a3 == 5)  ps3='F';        else if (a3 == 6)  ps3='G';        else if (a3 == 7)  ps3='H';        else if (a3 == 8)  ps3='I';        else if (a3 == 9)  ps3='J';        else if (a3 == 10) ps3='K';        else if (a3 == 11) ps3='L';        else if (a3 == 12) ps3='M';        else if (a3 == 13) ps3='N';        else if (a3 == 14) ps3='O';        else if (a3 == 15) ps3='P';        else if (a3 == 16) ps3='Q';        else if (a3 == 17) ps3='R';        else if (a3 == 18) ps3='S';        else if (a3 == 19) ps3='T';        else if (a3 == 20) ps3='U';        else if (a3 == 21) ps3='V';        else if (a3 == 22) ps3='W';        else if (a3 == 23) ps3='X';        else if (a3 == 24) ps3='Y';        else if (a3 == 25) ps3='Z';        if (h1 == ps1 && h2 == ps2 && h3 == ps3 && h == x)            break;    }    printf("%c %c %c %f %f\n", ps1, ps2, ps3, x, p);    return 0;}`
Last edited by Ed Davis on Jun 15, 2018 14:39, edited 1 time in total.
marcov
Posts: 2691
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Speed of FreeBasic

The benchmark might also be sensitive to the implementation of case/switch commands.
Ed Davis
Posts: 10
Joined: Jul 28, 2008 23:24

Re: Speed of FreeBasic

I've now added C++, using C++ strings. As expected, it is somewhat slower:

• C using switch and cast: gcc -Ofast: 0.86 seconds
• C using ifs, no cast: gcc -Ofast: 1.43 seconds
• C++ using strings, ifs, no casting: g++ -Ofast: 4.25 seconds
• QB64 v1.1: qb64 -x: 15.88 seconds
• FB 1.05 32-bit, compiled with: fbc -w all -gen gas -fpu sse -O 3: 16.65 seconds
• FB 1.05 32-bit, compiled with: plain fbc, no options: 16.76 seconds
• FB 1.05 32-bit, compiled with: fbc -w all -gen gcc -fpu sse -Wc -O3: 17.09 seconds

C++ version:

Code: Select all

`#include <cstdio>#include <string>using namespace std;int main() {    double p;    float x=-1;    float a1,a2,a3;    string ps1,ps2,ps3;    string h1,h2,h3;    float h;    p = 0;          /* need to init these for C */    a1=a2=a3=h=0;   /* need to init these for C */    h1="L";    h2="W";    h3="K";    h=3724;    for (;;) {        x+=1;        p+=1;        if (x>9999) {            x=0;            a3+=1;            if (a3>25) {                a3=0;                a2+=1;                if (a2>25) {                    a2=0;                    a1+=1;                }            }        }        if (a1 == 0)  ps1="A";        else if (a1 == 1)  ps1="B";        else if (a1 == 2)  ps1="C";        else if (a1 == 3)  ps1="D";        else if (a1 == 4)  ps1="E";        else if (a1 == 5)  ps1="F";        else if (a1 == 6)  ps1="G";        else if (a1 == 7)  ps1="H";        else if (a1 == 8)  ps1="I";        else if (a1 == 9)  ps1="J";        else if (a1 == 10) ps1="K";        else if (a1 == 11) ps1="L";        else if (a1 == 12) ps1="M";        else if (a1 == 13) ps1="N";        else if (a1 == 14) ps1="O";        else if (a1 == 15) ps1="P";        else if (a1 == 16) ps1="Q";        else if (a1 == 17) ps1="R";        else if (a1 == 18) ps1="S";        else if (a1 == 19) ps1="T";        else if (a1 == 20) ps1="U";        else if (a1 == 21) ps1="V";        else if (a1 == 22) ps1="W";        else if (a1 == 23) ps1="X";        else if (a1 == 24) ps1="Y";        else if (a1 == 25) ps1="Z";        if (a2 == 0)  ps2="A";        else if (a2 == 1)  ps2="B";        else if (a2 == 2)  ps2="C";        else if (a2 == 3)  ps2="D";        else if (a2 == 4)  ps2="E";        else if (a2 == 5)  ps2="F";        else if (a2 == 6)  ps2="G";        else if (a2 == 7)  ps2="H";        else if (a2 == 8)  ps2="I";        else if (a2 == 9)  ps2="J";        else if (a2 == 10) ps2="K";        else if (a2 == 11) ps2="L";        else if (a2 == 12) ps2="M";        else if (a2 == 13) ps2="N";        else if (a2 == 14) ps2="O";        else if (a2 == 15) ps2="P";        else if (a2 == 16) ps2="Q";        else if (a2 == 17) ps2="R";        else if (a2 == 18) ps2="S";        else if (a2 == 19) ps2="T";        else if (a2 == 20) ps2="U";        else if (a2 == 21) ps2="V";        else if (a2 == 22) ps2="W";        else if (a2 == 23) ps2="X";        else if (a2 == 24) ps2="Y";        else if (a2 == 25) ps2="Z";        if (a3 == 0)  ps3="A";        else if (a3 == 1)  ps3="B";        else if (a3 == 2)  ps3="C";        else if (a3 == 3)  ps3="D";        else if (a3 == 4)  ps3="E";        else if (a3 == 5)  ps3="F";        else if (a3 == 6)  ps3="G";        else if (a3 == 7)  ps3="H";        else if (a3 == 8)  ps3="I";        else if (a3 == 9)  ps3="J";        else if (a3 == 10) ps3="K";        else if (a3 == 11) ps3="L";        else if (a3 == 12) ps3="M";        else if (a3 == 13) ps3="N";        else if (a3 == 14) ps3="O";        else if (a3 == 15) ps3="P";        else if (a3 == 16) ps3="Q";        else if (a3 == 17) ps3="R";        else if (a3 == 18) ps3="S";        else if (a3 == 19) ps3="T";        else if (a3 == 20) ps3="U";        else if (a3 == 21) ps3="V";        else if (a3 == 22) ps3="W";        else if (a3 == 23) ps3="X";        else if (a3 == 24) ps3="Y";        else if (a3 == 25) ps3="Z";        if (h1 == ps1 && h2 == ps2 && h3 == ps3 && h == x)            break;    }    printf("%s %s %s %f %f\n", ps1.c_str(), ps2.c_str(), ps3.c_str(), x, p);    return 0;}`
MrSwiss
Posts: 2934
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Speed of FreeBasic

Just for fun (with code by: zxretrosoft):
Loop Until, sped up by using AndAlso (instead of, And)

Code: Select all

`loop until (h1=ps1 AndAlso h2=ps2) AndAlso (h3=ps3 AndAlso h=x)`

+ used fbc64 ver. 1.05.0: -s console -gen gcc -O 3 -fpu sse

runtime = approx.: 4.11 Seconds !!! <-- if you want to do:
speed comparisons, please do so, with "optimal" settings ...
(in all tested languages, otherwise, we have a Apple vs. Banana problem)
deltarho[1859]
Posts: 1707
Joined: Jan 02, 2017 0:34
Location: UK

Re: Speed of FreeBasic

MrSwiss wrote:Apple vs. Banana problem

You made me chuckle there: The phrase is actually 'Apples vs oranges'. Of course, you could use what you like 'Elephants vs. chimpanzees'.

I normally don't give sse a second thought so thanks for the your tip and Ed Davis - one code snippet has just put a hole in my ceiling so I will be checking it out further.
MrSwiss
Posts: 2934
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Speed of FreeBasic

deltarho[1859] wrote:The phrase is actually 'Apples vs oranges'.
While this may be correct in english, in german, we like to be, from afar different: it's as written ;-)
(since both of them, are still fruits, right?)
Last edited by MrSwiss on Jun 15, 2018 19:32, edited 1 time in total.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: Speed of FreeBasic

zxretrosoft wrote:Hi friends,
You might be interested.
I made a simple algorithm, intentionally brute force with CASE.

I wonder, you have not C in your comparison, only C++ and C#. At Benchmarksgame C had the first place.

https://benchmarksgame-team.pages.debia ... stest.html
caseih
Posts: 1318
Joined: Feb 26, 2007 5:32

Re: Speed of FreeBasic

marcov wrote:The benchmark might also be sensitive to the implementation of case/switch commands.

Yes it very much is. And in fact, case/switch is completely unnecessary for this search. Especially in C. A char is already a number; just use it directly. Just remove the switch stuff entirely, and make the alphabet based on 0, just like the code I posted. The speed up will be fairly dramatic.

As to Ed's port to C++ strings... why would you ever use C++ strings in this fashion?

Interesting that Javascript was faster than FB. This might mean that the JIT compiler in javascript recognized that the switch statement is unnecessary and optimized it out.
marcov
Posts: 2691
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Speed of FreeBasic

caseih wrote:
marcov wrote:The benchmark might also be sensitive to the implementation of case/switch commands.

Yes it very much is. And in fact, case/switch is completely unnecessary for this search. Especially in C. A char is already a number; just use it directly. Just remove the switch stuff entirely, and make the alphabet based on 0, just like the code I posted. The speed up will be fairly dramatic.
....

Compilers that are used as backend-language (like FB uses gcc as backend for cgen) for other development tools have such optimizations, since such frontend tools are usually not very optimizing, and the way code is generated block-by-block might make the resulting code weird and subject to optimizations one doesn't really need for human somewhat sane generated code.

For languages that are not a typical backend language optimizing such statements away is not as rewarding (lot of work to reward totally clueless users).

Also the case/switch statement itself has multiple possible choices, depending on target architecture. E.g. 8-bit micros often implement a binary search tree, since that 2logs() the number of instructions (roughly)

But for modern processors that is often bad again since that is too branchy (2log branches taken). Also they often care about alignment of branch targets.

Anyway, this is probably the usual microbenchmark. To be honest, if a benchmark is a math related problem/algorithm in one single sourcefile, and is advocated as a general benchmark (IOW without very specific explanations what it tests and why), I usually don't even bother to check it out. They are usually bad models for applications that do something, and not very useful for any purpose.
enform
Posts: 163
Joined: Apr 24, 2011 12:57
Location: France

Re: Speed of FreeBasic

Hello,
I just post a few results in 32 or 64 bits with 2 source codes zxretrosoft's code and the modified caseih's version .
+ a problem with gcc32 . --> Edit : solved by St_W , libexec folder missing (but was in gcc-5.2.0-for-FB-win32-gengcc.zip ... )

Edit with the correct results ... :

zxretrosoft :

' 32 gas by default : 20 s with and
' 32 gas by default : 13.7 s with andalso
' 32 gas fbc -s console -arch 32 -fpu sse -O 3 : 19.5 with and
' 32 gas fbc -s console -arch 32 -fpu sse -O 3 : 13.4 with andalso
' 32 gcc fbc -s console -gen gcc : 21.4 with and
' 32 gcc fbc -s console -gen gcc : 14.4 with andalso
' 32 gcc fbc -s console -gen gcc -O 3 : 21.5 with and
' 32 gcc fbc -s console -gen gcc -O 3 : 14.43 with andalso

' 64 fbc -s console -arch 64 -gen gcc: 11.5 with and
' 64 fbc -s console -arch 64 -gen gcc: 8.6 with andalso
' 64 fbc -s console -arch 64 -gen gcc -O 3 :10.3 with and
' 64 fbc -s console -arch 64 -gen gcc -O 3 : 7.7 with andalso

with :
fbc -s console -arch 32 -gen gcc -O 3 ?
fbc -s console -arch 32 -fpu sse -O 3
fbc -s console -arch 64 -gen gcc --> or -O 3

caseih :

' 32 gas by default : 0.65 s with and
' 32 gas by default : 0.35875 s with andalso
' 32 fbc -s console -arch 32 -fpu sse -O 3 : 0.371
' 32 fbc -s console -gen gcc : 0.68 with and
' 32 fbc -s console -gen gcc : 0.44 with andalso
' 32 fbc -s console -gen gcc -O 3 : 0.24 with and
' 32 fbc -s console -gen gcc -O 3 : 0.061 with andalso !

' run 3 x
' 64 fbc -s console -arch 64 -gen gcc : 0.46 with and
' 64 fbc -s console -arch 64 -gen gcc : 0.475 with andalso
' 64 fbc -s console -arch 64 -gen gcc -O 3 : 0.27 with and
' 64 fbc -s console -arch 64 -gen gcc -O 3 : 0.06 with andalso !

with :
fbc -s console -arch 32 -gen gcc -O 3 ?
fbc -s console -arch 32 -fpu sse -O 3
fbc -s console -arch 64 -gen gcc --> or -O 3

Now , if a specialist can help me with gcc 32 bits that fails , i will appreciate !!! ; I can also start a new thread...

I downloaded gcc from sf , like fbc ; Please , see the results with 64 bits (ok) and 32 bits ( not ok) :

( the error : gcc.exe: error: CreateProcess: No such file or directory )

F:\Prog\FreeBASIC-1.05.0-win64\fbc -s console -gen gcc -O 3 -v "SpeedTest3.bas"
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win64 (64bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win64, x86-64, 64bit
compiling: SpeedTest3.bas -o SpeedTest3.c (main module)
compiling C: F:\Prog\FreeBASIC-1.05.0-win64\bin\win64\gcc.exe -m64 -march=x86-64 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O3 -fno-strict-aliasing -frounding-math -fno-math-errno -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -masm=intel "SpeedTest3.c" -o "SpeedTest3.asm"
assembling: F:\Prog\FreeBASIC-1.05.0-win64\bin\win64\as.exe --64 --strip-local-absolute "SpeedTest3.asm" -o "SpeedTest3.o"
linking: F:\Prog\FreeBASIC-1.05.0-win64\bin\win64\ld.exe -m i386pep -o "SpeedTest3.exe" -subsystem console "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64\fbextra.x" --stack 1048576,1048576 -s -L "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64" -L "." "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64\crt2.o" "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64\crtbegin.o" "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64\fbrt0.o" "SpeedTest3.o" "-(" -lfb -lgcc -lmsvcrt -lkernel32 -luser32 -lmingw32 -lmingwex -lmoldname -lgcc_eh "-)" "F:\Prog\FreeBASIC-1.05.0-win64\lib\win64\crtend.o"

Make done

F:\Prog\FreeBASIC-1.05.0-win32\fbc -s console -gen gcc -O 3 -v "SpeedTest3.bas"
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target: win32, 486, 32bit
compiling: SpeedTest3.bas -o SpeedTest3.c (main module)
compiling C: F:\Prog\FreeBASIC-1.05.0-win32\bin\win32\gcc.exe -m32 -march=i486 -S -nostdlib -nostdinc -Wall -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-main -Werror-implicit-function-declaration -O3 -fno-strict-aliasing -frounding-math -fno-math-errno -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -masm=intel "SpeedTest3.c" -o "SpeedTest3.asm"
gcc.exe: error: CreateProcess: No such file or directory
compiling C failed: 'F:\Prog\FreeBASIC-1.05.0-win32\bin\win32\gcc.exe' terminated with exit code 1

Thank you
Last edited by enform on Oct 15, 2018 21:45, edited 3 times in total.
St_W
Posts: 1460
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Speed of FreeBasic

That most likely means you're missing cc1.exe, which is the C compiler. You have to put it in a special folder relative to gcc.exe so that it is found. The folder structure of the gcc addon for fb should be fine, so keep it and do not mess around.
enform
Posts: 163
Joined: Apr 24, 2011 12:57
Location: France

Re: Speed of FreeBasic

Yes , exactly : libexec folder missing (but was in gcc-5.2.0-for-FB-win32-gengcc.zip ... )
Completed the results for gcc 32 .

--> Edited previous post with the correct results ...

Thank you
Posts: 1182
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Speed of FreeBasic

MrSwiss wrote:
deltarho[1859] wrote:The phrase is actually 'Apples vs oranges'.
While this may be correct in english, in german, we like to be, from afar different: it's as written ;-)
(since both of them, are still fruits, right?)

Funny, here in the Netherlands, we compare apples with pears.
jj2007
Posts: 1066
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Speed of FreeBasic

badidea wrote:Funny, here in the Netherlands, we compare apples with pears.
Same in German, Äpfel und Birnen.