Page 2 of 3

Posted: Sun May 22, 2005 11:04 pm
by traumatic
LuCiFeR[SD] wrote:I have a honda... so I must have a small, erm, thing lol
It's the other way around :lol:

Posted: Sun May 22, 2005 11:07 pm
by LuCiFeR[SD]
AHAHAHAHAHAHAHAHAHA! Touché :)

Posted: Sun May 22, 2005 11:31 pm
by thefool
yeah fred does do a nice job. Sad the code is faster for blitz but anyway the exe is 117 TIMES bigger.. its right! 820/7 = 117+

Posted: Mon May 23, 2005 1:35 am
by Inner
it's only bigger if you don't use the framework, without the framework and explisitly telling it what to include and what not to include it will, afaik, include everything, this is to the best of my understanding.

however having said that exe's are bigger slightly anyway even using this method anyhow.

Posted: Mon May 23, 2005 8:37 pm
by perb
LuCiFeR[SD] wrote:va!n: The code posted by you compiles to 820 KB (839,680 bytes). The only reason I know this is cause I bought BlitzMax... Although I have yet to even write one line of code in it LOL.
You have to change the Blitzmax-Code to:

Code: Select all

Framework BRL.StandardIO
Import BRL.System

Const ITERATIONS = 10000

Local Flags [8191]
Print "SIEVE OF ERATOSTHENES - " + ITERATIONS + " iterations"

X = MilliSecs()

For Iter = 1 To ITERATIONS

  Count = 0

  For I = 0 To 8190
    Flags[I] = 1
  Next

  For I = 0 To 8190
    If Flags[I]=1 Then
       Prime = I + I
       Prime = Prime + 3
       K = I + Prime
       While K <= 8190
         Flags[K] = 0
         K = K + Prime
       Wend
       Count = Count + 1
    EndIf
  Next

Next

X = MilliSecs () - X

Print "1000 iterations took "+(X/1000.0)+" seconds."
Print "Primes: "+Count
End 
The Keyword "Framework" excludes all modules from beeing imported.

Then it compiles down to 43 KB (with upx 19 KB) - not too bad. On my machine the blitzmax-code above runs in 0.889999986 seconds. The posted PB-Code (with 10000 iterations) needs 2.625000 seconds.

Posted: Tue May 24, 2005 1:05 am
by va!n
Then it compiles down to 43 KB (with upx 19 KB) - not too bad. On my machine the blitzmax-code above runs in 0.889999986 seconds. The posted PB-Code (with 10000 iterations) needs 2.625000 seconds.

Hi perb!
Thanks for sharing this changed BlitzMax source for small size! In this benchmark BlitzMax wins but i know some other Benchmarks where PureBasic has won! ;-) I tested both sources on my AMD3200@2,0 Ghz with 512 MB RAM!

Here are my results...

Code: Select all

PureBasic  7.168 bytes     vs     BlitzMax  43.520 bytes    (44.032 bytes with added Input() @ EOF *g*)
PureBasic  2.780000        vs     BlitzMax  0.916000009
Congratulation to Fred for the small size and congratulation to Mark for the speed! Fred, i will send you some stuff my smail, with that stuff you can improve the speed for the next x86 based releases a lot :-)


Edit:
I tested it with this sources:

Code: Select all

Changed BlitzMax using framework and imports for small size  by perb:

Framework BRL.StandardIO
Import BRL.System

Const ITERATIONS = 10000

Local Flags [8191]
Print "SIEVE OF ERATOSTHENES - " + ITERATIONS + " iterations"

X = MilliSecs()

For Iter = 1 To ITERATIONS

  Count = 0

  For I = 0 To 8190
    Flags[I] = 1
  Next

  For I = 0 To 8190
    If Flags[I]=1 Then

       Prime = I + I
       Prime = Prime + 3
       K = I + Prime
       While K <= 8190
         Flags[K] = 0
         K = K + Prime
       Wend
       Count = Count + 1
    EndIf
  Next

Next

X = MilliSecs () - X

Print "1000 iterations took "+(X/1000.0)+" seconds."
Print "Primes: "+Count
End

Code: Select all

BlitzMax to PB converted source by thefool:

OpenConsole()

#ITERATIONS = 1000

Dim Flags(8191)
PrintN ("SIEVE OF ERATOSTHENES - " + Str(#ITERATIONS) + " iterations")

X.f = GetTickCount_()

For Iter = 1 To #ITERATIONS
 
  Count = 0
 
  For I = 0 To 8190
    Flags(I) = 1
  Next
 
  For I = 0 To 8190
    If Flags(I)=1
     
      Prime = I + I
      Prime = Prime + 3
      K = I + Prime
      While K <= 8190
        Flags(K) = 0
        K = K + Prime
      Wend
      Count = Count + 1
    EndIf
  Next
 
Next

X.f = GetTickCount_() - X.f

PrintN ("1000 iterations took "+StrF((X.f/1000))+" seconds.")
PrintN( "Primes: "+Str(Count))

Input()

Posted: Tue May 24, 2005 1:18 am
by Shannara
Um, according to your test, PB wins, not BlitzMax since .9 is longer then .2.

Posted: Tue May 24, 2005 1:20 am
by va!n
Shannara wrote:Um, according to your test, PB wins, not BlitzMax since .9 is longer then .2.
mhhh... its 0.9 and 2.7 :wink:

Btw, when compiling and running topic changed BlitzMax source, you will not see any results because the windows is closing directly after executing! So we have to add "Input" to the end of the BlitzMax source as we did in the PureBasic version!

When added the "Input" command, the BlitzMax created exe will be 44.032 bytes instead before 43.520 ;)

Posted: Tue May 24, 2005 3:11 am
by Dare2
Succumbed to temptation, DLed and had a quick look.

It has some really potent options!

Is this true or did my quick look in the docs miss something:

.. No ability to use a dll? (Or make one?)
.. Console only, no windows?

However there is some really nice stuff in there, esp (obviously) for graphics, and also for using other lang sources! (But really no dll access? - puzzled!)

Posted: Tue May 24, 2005 3:42 am
by Shannara
Oops! Sorry for the misread. Dont feel too bad about comparing BM with PB. I mean even VB has beatened PB on a few tests :)

Posted: Tue May 24, 2005 8:20 am
by LuCiFeR[SD]
perb wrote:
LuCiFeR[SD] wrote:va!n: The code posted by you compiles to 820 KB (839,680 bytes). The only reason I know this is cause I bought BlitzMax... Although I have yet to even write one line of code in it LOL.
You have to change the Blitzmax-Code to:

Code: Select all

Framework BRL.StandardIO
<SNIP> 
Well, there ya go... I didn't know that. Cheers perb, learn something new every day :).

Posted: Tue May 24, 2005 3:48 pm
by va!n
Dare2 wrote:Succumbed to temptation, DLed and had a quick look.

It has some really potent options!

Is this true or did my quick look in the docs miss something:

.. No ability to use a dll? (Or make one?)
.. Console only, no windows?

However there is some really nice stuff in there, esp (obviously) for graphics, and also for using other lang sources! (But really no dll access? - puzzled!)
@Dare2:
about access to DLL, i dont know if bm support it but i think its possible (maybe with 3rd part commands!?)

in BM you can use console, windows and screens... btw i havent seen any window example with GUI for appz coding... I think BM is again mainly for game and demo developers. maybe mark will add GUI stuff for appz too but futuremore i think he will bring again a new version called something like BlitzMaxPlus for GUI app coding... :lol:

Posted: Tue May 24, 2005 4:26 pm
by blueznl
... and after BlitzMaxPlus the BlitzMaxPlusExtra and BlitzMaxPlusExtraLimitedEdition...

(not flaming, just joking)

Posted: Tue May 24, 2005 7:19 pm
by Num3
Lol,

A GUI and 3D Engine system is going to be implemented to the next MacOs release of BMax... Later on windows and Linux...

Theres no built-in DLL access, since the code is multiplatform, but you can always build your own modules to support that...

There are some to use DX9 already...

Of course Bmax is mainly a game platform, where executable sizes don't make much of a diference, since MEDIA takes 99% of all space nowdays :P

If you run UPX on it, you can get a "decent" (compared to PB) size.... < 500Kb

Posted: Tue May 24, 2005 10:02 pm
by MadMax
I bought Bmax a couple of days ago, so I haven't had too much time to test it extensively. ATM I'm making a simple arkanoid type of game, it has some nice features, but on the whole and at this moment PB is a more complete product. As far as speed, well, I don't care that much about sieves and stuff like that, as far as 2D gfx in a complete program, I'd say PB is probably faster, but both are sufficiently fast on any nowadays PC.

Haven't had a chance to try it out on Linux.

I will still continue to use PB as it's still my favourite language.