Anyone's afraid of BlitzMax speed?

For everything that's not in any way related to PureBasic. General chat etc...
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

dagcrack wrote:...math routines in PB - (even today they are lacking, and yes, they are a must if you ask me)
what functions are missing?
Max.
Enthusiast
Enthusiast
Posts: 225
Joined: Fri Apr 25, 2003 8:39 pm

Post by Max. »

Void.
Last edited by Max. on Thu Apr 06, 2006 5:48 pm, edited 1 time in total.
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

The last benchmark for this week, I've put almost 5 hours in the PB and BMX ports of the C source. It's the famous Whetstone benchmark and I really expected to be PB slightly faster then BMX. Grab the files here: http://www.kudoscry.com/public/test.zip
Here are my results:
WhetMax - V1.12demo - Size: 86.5KB

Code: Select all

Date		March 23th, 2006
Model		x64
CPU		AMD Athlon64 3.500+ Venice
Clock MHz	2.200 MHz
Cache		1024 MB
H/W options	----
OS		WindowsXP Professional SP2
Compiler	BlitzMax
Run by		Sebe
Website		www.kudoscry.com
Email		sebe[at]kudoscry.com

Loop content                   Result            MFLOPS      MOPS     Seconds

N1 floating point   -1.1333333423928149        401.738                0.492
N2 floating point   -1.1333333028508248        307.366                4.506
N3 if then else      1.0000000000000000                  657.158      1.622
N4 fixed point      12.000000000000000                  -321.943      3.257
N5 sin,cos etc.      0.50000002270777300                  32.212      26.615
N6 floating point    0.95218875631952249        40.690                31.052
N7 assignments       3.0000000000000000                  330.618      5.7599
N8 exp,sqrt etc.     0.75190779087935466                  14.693      26.090

MWIPS: 1036.735	Time: 99.398 Seconds
Results  to  load  to  spreadsheet                MWIPS   Mflops1   Mflops2   Mflops3    Cosmops   Expmops  Fixpmops    Ifmops    Eqmops
Results  to  load  to  spreadsheet              1036.735  401.738   307.366   40.690      32.212    14.693  -321.943   657.158   330.618

PureWhet - V4.00beta7 - Size: 17KB

Code: Select all

Date		March 23th, 2006
Model		x64
CPU		AMD Athlon64 3.500+ Venice
Clock MHz	2.200 MHz
Cache		1024 MB
H/W options	----
OS		WindowsXP Professional SP2
Compiler	Pure Basic
Run by		Sebe
Website		www.kudoscry.com
Email		sebe[at]kudoscry.com

Loop content                   Result            MFLOPS      MOPS     Seconds

N1 floating point   -1.13333334264883060        262.673                0.586
N2 floating point   -1.13333330113013850        201.663                5.343
N3 if then else      1.00000000000000000                  421.412      1.969
N4 fixed point      12.00000000000000000                  600.846      4.203
N5 sin,cos etc.      0.50000005916892443                  40.929      16.297
N6 floating point    1.00000000000000000        127.834                33.828
N7 assignments       3.00000000000000000                  102.508      14.453
N8 exp,sqrt etc.     0.75221521343150866                  13.046      22.860

MWIPS: 805.413	Time: 99.539 Seconds
Results  to  load  to  spreadsheet                MWIPS   Mflops1   Mflops2   Mflops3    Cosmops   Expmops  Fixpmops    Ifmops    Eqmops
Results  to  load  to  spreadsheet              805.413   262.673   201.663   127.834     40.929    13.046   600.846   421.412   102.508
No comment on this one, I'm a little bit disappointed. Not of PB or the team or Fred. PB is still as fast as C (and the C bench used single precision!) but I really didn't expect to see BMX ahead. Still: I again realized that coding PB is much more comfortable (and logical) than coding BMX :twisted:

Some information about the test:

N1: Simple calcs with double type arrays
N2: Passing arrays as function parameter
N3: Conditional jumps
N4: Integer arithmetic
N5: Trigonom. functions
N6: Procedure calls (passing integer vars and pointers of double vars)
N7: Array references
N8: Standard math functions
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

I see that the results differ, which one of PB/BMX produces the correct result?
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

PB. The floats and doubles in BMX are not as precise :? Look at the BBP test to see that.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

Sebe wrote:PB. The floats and doubles in BMX are not as precise :? Look at the BBP test to see that.
What's the point with fast iterations if the result isn't correct? These tests don't tell a thing if they don't produce the same results imho!
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

Well, it's a speed test. But you're right, we need some accuracy tests... :twisted:
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Sebe wrote:Well, it's a speed test. But you're right, we need some accuracy tests... :twisted:
:lol: Just return 0 then... *headdesk*
Good programmers don't comment their code. It was hard to write, should be hard to read.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Sebe wrote:PB. The floats and doubles in BMX are not as precise :? Look at the BBP test to see that.
Psychophanta wrote:First one:
Trigonometric functions returned by blitzmax are returned as double float, but only the first 8 (sometimes 6) decimals are true, the other 10 (or more) are literally invented :!:
I guess it has a table of results used to deliver some math functions.
Clearly this language is only focused for games :?
http://www.purebasic.fr/english/viewtop ... c&start=60

I have a sneaking suspicion along with Psychophanta that BMX makes heavy use of precalculated math values at a very low precision for maximum speed, skewing any benchmarking.
--Kale

Image
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

I have a sneaking suspicion along with Psychophanta that BMX makes heavy use of precalculated math values at a very low precision for maximum speed, skewing any benchmarking.
:shock: I didn't knew that! That's just lame :? I'm very happy that PB doesn't do that. I just can't say how disappointing that is (and I'm not even a fan of BMX, the syntax is just crap FOR ME) :shock:
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

gfa had sin and sinq commands for speed purposes
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Lebostein
Addict
Addict
Posts: 829
Joined: Fri Jun 11, 2004 7:07 am

Post by Lebostein »

Please check in MonteCarlo the calculation of radius!

BlitzBasic:

Code: Select all

DOTX * DOTX + DOTY * DOTY
PureBasic:

Code: Select all

Pow(DOTX, 2.0) + Pow(DOTY, 2.0)
That's unfair to PB! :evil: Same conditions for all!

So far (10.000.000 drops and float):

Code: Select all

PB: 7188 ms
BMX: 4925 ms
Change the calculation in PB to DOTX * DOTX + DOTY * DOTY, like Blitz:

Code: Select all

PB: 1141 ms (5 times faster!)
BMX: 4925 ms
:D
---------------------
And please get the time in Blitz after the loop (like PB) and not after the console-output. At the moment it's unfair to BlitzBasic:

PB:

Code: Select all

  t = GetTickCount_() - t
  PrintN("PI (" + Str(total) + " drops) on float: " + StrF(PI, 18))
  PrintN("Time needed: " + Str(t) + " m/secs")
Blitz:

Code: Select all

  	Print "PI (" + String(total) + " drops) on float: " + String(MYPI)
  	Print "Time needed: " + (MilliSecs() - t) + " m/secs"
Sebe
Enthusiast
Enthusiast
Posts: 160
Joined: Sun Dec 19, 2004 10:55 pm
Location: Munich
Contact:

Post by Sebe »

Thanks, I'll change that when I'm home again :)
Post Reply