BlitzMax for Windows

Everything else that doesn't fall into one of the other PB categories.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post 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:
Good programmers don't comment their code. It was hard to write, should be hard to read.
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Post by LuCiFeR[SD] »

AHAHAHAHAHAHAHAHAHA! Touché :)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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+
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post 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.
perb
New User
New User
Posts: 8
Joined: Mon May 23, 2005 8:27 pm

Post 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.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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()
Last edited by va!n on Tue May 24, 2005 1:28 am, edited 3 times in total.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Um, according to your test, PB wins, not BlitzMax since .9 is longer then .2.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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 ;)
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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!)
@}--`--,-- A rose by any other name ..
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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 :)
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Post 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 :).
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post 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:
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

... and after BlitzMaxPlus the BlitzMaxPlusExtra and BlitzMaxPlusExtraLimitedEdition...

(not flaming, just joking)
( 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... )
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post 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
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Post 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.
Post Reply