Programming Languages Benchmark

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Programming Languages Benchmark

Post by caseih »

pidd wrote: Dec 27, 2022 4:14I was hugely disappointed that php7.4 was a long way out the running at around 8 times slower than fbc, I haven't profiled to find out why but my php is set up for development which would add unnecessary overhead. I suspect php8.2 would perform considerably better but I haven't got php8 loaded up anywhere yet.
And yet PHP is probably 8 times faster than FB at developing and running web sites! :) And PHP would scale way better than FB ever would, largely because of the way the infrastructure works, despite its interpreted nature. CGI (which is what FB is limited to) is seriously slow for web apps.

Benchmarks like this one are of extremely limited use.
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Programming Languages Benchmark

Post by marcov »

Pure (not fast-) CGIs are only interesting because they are the simplest native form of webserver<-> application communication. In reality you always use some fastcgi, isapi or mod_cgi thingy.

I did ISAPI dll frameworks in Delphi almost two decades ago, and it ran circles around PHP

The core advantage of an interpreter solution is live editing of everything, not speed.
pidd
Posts: 31
Joined: Nov 11, 2022 16:27

Re: Programming Languages Benchmark

Post by pidd »

dodicat wrote: Dec 28, 2022 14:41 I read somewhere that Microsoft included qbasic (interpreted quickbasic) in their earlier versions (DOS, win 95/98/me up to but excluding win 2000) because people would have to purchase quickbasic if they wanted a compiler.
So it was a cash driven idea.
The compilation was pretty pointless, programs ran no faster whether they were compiled or "interpreted", however there was extra functionality in the IDE which made development easier. I still rate the IDE as one of the best I have come across, simple but highly functional. Some modern IDE's waste my time fighting against them, I have a rubbish memory so things need to be simple.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Programming Languages Benchmark

Post by caseih »

I used to think that also, but I was incorrect. QB had two ways of making the EXE. One was the threaded p-code with bundled interpreter and the other was the "stand-alone exe file" which apparently was a real compilation that made code as a fast as any compiler at the time. I just fired up QB45 and sure enough, there are two options when making the exe. I vaguely remember knowing this in the past but certainly had forgotten.

I agree the IDE was amazing. Even by today's standards it is still pretty good. Especially how it lets you explore the program's structure with the sub/function browser, and how it keeps them all separate. And when you're typing source code, it compiles on the fly so you can tell if you've typed in "good" code because it automatically capitalizes the keywords. Only missing syntax coloring! I obviously have a soft spot for QB.

I remember reading this a few years ago: http://www.nicolasbize.com/blog/30-year ... -the-best/
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Programming Languages Benchmark

Post by Provoni »

How do I get this to work? Using FreeBASIC 1.10:

Code: Select all

C:\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgsl
C:\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin\win64\ld.exe: cannot find -lgslcblas
Thanks
srvaldez wrote: Sep 14, 2022 0:29 @caseih
from https://stackoverflow.com/questions/406 ... -using-gsl
your example with a tiny mod

Code: Select all

#include "gsl/gsl_matrix.bi"
#include "gsl/gsl_linalg.bi"
#include "gsl/gsl_blas.bi"

Dim StartTime As Double, EndTime as Double

Dim As gsl_matrix Ptr A = gsl_matrix_alloc(1024, 1024)
Dim As gsl_matrix Ptr B = gsl_matrix_alloc(1024, 1024)
Dim As gsl_matrix Ptr C = gsl_matrix_alloc(1024, 1024)

For i As Integer = 0 To 1023
    For j As Integer = 0 To 1023
        gsl_matrix_set (A, i, j, rnd)
        gsl_matrix_set (B, i, j, rnd)
    Next
next

print("FreeBasic Matrix Multiplication Benchmark started. Please wait...")

StartTime = Timer
'gsl_linalg_matmult(A,B,C)
gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, B, A, 0.0, C)
EndTime = Timer

print("Free Basic Matrix Multiplication Benchmark finished in: " & (EndTime-StartTime) & " seconds")
Sleep
Free Basic Matrix Multiplication Benchmark finished in: 0.497285199999169 seconds
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Programming Languages Benchmark

Post by caseih »

What operating system? You need the GSL shared libraries installed or downloaded. They are not part of FreeBASIC.

If on Windows, are you doing 64-bit or 32-bit FreeBASIC? I have dlls for both 32 and 64-bit windows that are known to be good; they are part of my Fedora Linux distribution stock packages, part of the cross compiling tools. I can post a zip of them. I think there are good links on the forum here too somewhere.
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Programming Languages Benchmark

Post by Provoni »

caseih wrote: Aug 24, 2023 22:11 What operating system? You need the GSL shared libraries installed or downloaded. They are not part of FreeBASIC.

If on Windows, are you doing 64-bit or 32-bit FreeBASIC? I have dlls for both 32 and 64-bit windows that are known to be good; they are part of my Fedora Linux distribution stock packages, part of the cross compiling tools. I can post a zip of them. I think there are good links on the forum here too somewhere.
Windows 11, 64-bit FreeBASIC. I would welcome the dll's.
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: Programming Languages Benchmark

Post by srvaldez »

Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Programming Languages Benchmark

Post by Provoni »

srvaldez wrote: Aug 25, 2023 16:14 Provoni here they are https://u.pcloud.link/publink/show?code ... t9t8RAb66V
Thanks, I have absolutely no idea where these files are supposed to go. It put them in the root of my program but that didn't work.
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: Programming Languages Benchmark

Post by srvaldez »

sorry for the lousy help, please re-download again and after unpacking, place the *.dll.a files into the FB win64 lib folder
the dlls need to be where your program is located or somewhere on the Windows PATH
[ frankly, I got used to not getting any response from my posts so I don't check the forum very often ]
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Programming Languages Benchmark

Post by Provoni »

srvaldez wrote: Aug 25, 2023 17:09 sorry for the lousy help, please re-download again and after unpacking, place the *.dll.a files into the FB win64 lib folder
the dlls need to be where your program is located or somewhere on the Windows PATH
[ frankly, I got used to not getting any response from my posts so I don't check the forum very often ]
Thanks srvaldez, it works now. :)
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: Programming Languages Benchmark

Post by oyster »

as for python, you can try shekskin, pypy
Post Reply