PDA

View Full Version : Some benchmarks



RobbeK
02-10-2013, 15:27
Hi all,
FWIIW , same program (50 iterations of drawing a fractal ) written in diff. programming languages.

Thinbasic (Ui + TBGL + Oxygen) : around 2 min.
Powerbasic 6 Console compiler : using REDRAW : around 1 min.
QB64 - GL : using _DISPLAY _AUTODISPLAY switches -- 15 sec
GFA compiler (+ OPENGL and some inline Assembler) -- 7 sec
FreePascal (without Assembler code) - around 3 sec.

I attached the Pascal prog to have an idea about the speed. It's console only - you need the mouse to change the parameters. For the Rc and Ri value point at the digit you want to change and use a left or right mouse click to in/decrement - for the iteration level there's a + and a -.

If TBGL instructions could be incorporated inside Oxygen scripts , imho it could speed up things a lot.

regards Rob

Petr Schreiber
02-10-2013, 16:33
Hi Robbek,

could you please post the code for all the languages, including PowerBASIC and ThinBASIC?
The EXE file in the attachement does produce error message, because it usees full path to font file (F:\fonts.fnt)


Petr

RobbeK
02-10-2013, 19:00
Hi,

Oops, that's annoying .. the font is called by the dll and I expected it was sufficient it was in the same directory. :-(
I see no other way than to install the freepascal on the C drive and compile it again.
Attached the executables and/or scripts , and this time tested from USB stick on another computer. (except the Thinbasic script).
As for the GFA, to make a fair compare , the first field is the Real component of C (0 used with the other programs) , second field is the Imaginary component (1), 3rd is the maximum number of iterations, which is 17 in the other programs.
For the QB64 - the input is 0 and 1 (and if you can have a look - the screen is setup to 640x480, but the size looks different when executed - in principle this program translates to C++ and compiles ).
As for the powerbasic , I do not know much about it, just used something as a skeleton to build something.
I also added something written in Freebasic (compiles to the GNU assembler (GAS) I think -- it's very fast, here also OpenGL is used).
(Just like Powerbasic, it uses a Firefly RAD (freeware this time) - however , no graphics possible (I think called Firelines ?) )

best Rob (I'll recompile the Freepascal )
PS : on my newer laptop , the programs not only run a lot faster, but especially the Powerbasic got a boost.

RobbeK
03-10-2013, 15:10
Attached the Freepascal exec.
The font needs to be in C:\TestPas\

best, Rob

ErosOlmi
03-10-2013, 21:00
Dear Rob,

thanks a lot for your benchmarks examples.

It is quite clear that thinBasic comes out with all the bones broken from this comparison :)

On the other end thinBasic seems the only fully interpreter languages (no pcode or other intermediate language) of the pack: all other used languages are compiled.
Considering this ... it is not that bad but at the same time it is an incentive to improve parsing and execution speed.

Ciao
Eros

RobbeK
03-10-2013, 22:48
Hi Eros,

Sure, - and I should have mentioned - it's a completely unfair compare towards Thinbasic. I think the speed (TB) is level with a good pseudo code compiler. (to be honest I was thinking it compiled into p-codes).
Things like fractals, chess-engines, Monte Carlo analysis etc.. is only used by 0.0..1 % of the computer users , all the other things will be delivered in the "same" time as a compiler : 0.1 sec or 0.002 sec doesn't matter ;-)
Important is that it's a rich and easy language with a rapid developing time - I've written some practical programs (to calculate time increase/decrease by temperature for chemical processes in Thinbasic ).
Infact it's in a way more important to have good help files and documentation (and good help especially) -- and finding that graphic library for Freepascal took some time too. (It's faster than the Wingraph unit - and Wingraph is faster than what comes with the distribution).

best, Rob
(I'm not a pedant person, just wanted to show benchmarks somewhat different from the classic ones (including graphics because graphics became an important part of the concept)

ErosOlmi
03-10-2013, 23:14
Hi Rob,

having people like you here in forum posting such a nice examples you posted it's really a pleasure and a present.

So thanks a lot.
Eros

RobbeK
04-10-2013, 13:35
Thanks Eros,

To make a more fair compare (and to cheer you up :-) , attached written in JustBasic (a stripped down version of Liberty Basic - running at the same speed) ,
http://justbasic.com/
To gain some speed , translated to BBC Basic (LB Booster) and compiled into an exec.
http://www.bbcbasic.co.uk/lbb/

Not 50 frames this time, just one (that's enough ;-).
To be fair , the Justbasic can't do graphic flipping (at least I did not find something) - all vars are global with auto-declaration etc ...
(But it is faster than things like Microsoft Small Basic and Panoramic Basic etc ... )
"The" surprise for me, was the speed of FreePascal (if you left/right click the CR and CI digits you will notice) ... after all it needs millions of calculations per frame .... (and it's written on a 600x600 display, the others on 600x480)

best Rob,