Page 5 of 5

Posted: Wed Mar 22, 2006 8:50 pm
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?

Posted: Wed Mar 22, 2006 8:53 pm
by Max.
Void.

Posted: Thu Mar 23, 2006 2:55 pm
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

Posted: Thu Mar 23, 2006 6:42 pm
by Pupil
I see that the results differ, which one of PB/BMX produces the correct result?

Posted: Thu Mar 23, 2006 6:50 pm
by Sebe
PB. The floats and doubles in BMX are not as precise :? Look at the BBP test to see that.

Posted: Thu Mar 23, 2006 7:01 pm
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!

Posted: Thu Mar 23, 2006 7:08 pm
by Sebe
Well, it's a speed test. But you're right, we need some accuracy tests... :twisted:

Posted: Thu Mar 23, 2006 7:09 pm
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*

Posted: Thu Mar 23, 2006 9:32 pm
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.

Posted: Thu Mar 23, 2006 10:10 pm
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:

Posted: Thu Mar 23, 2006 10:11 pm
by blueznl
gfa had sin and sinq commands for speed purposes

Posted: Fri Mar 24, 2006 7:54 am
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"

Posted: Fri Mar 24, 2006 1:49 pm
by Sebe
Thanks, I'll change that when I'm home again :)