Page 1 of 3

BlitzMax for Windows

Posted: Sun May 22, 2005 9:53 pm
by va!n
a few mins ago, i downloaded the free trial version of BlitzMax for Windows and tested the included sample a bit!

Every compiled and saved program is over 800 KB without debugger! (i still think this is due fact of the trial limited version because the compiler info window display all passes (4 and more passes are possible!).

Here is a small original blitzmax benchmark test but i havent had the time to test the same with purebasic!

Code: Select all

; ---- Blitz Max Source - Winodws  ----

' Ported from another Basic for benchmarking purposes...

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
This is a copy from the compiler info window of the topic source...

Code: Select all

Building bench
Compiling:bench.bmx
flat assembler  version 1.51
3 passes, 2657 bytes.
Linking:bench.exe
Executing:bench.exe
SIEVE OF ERATOSTHENES - 10000 iterations
1000 iterations took 0.871999979 seconds.
Primes: 1899

Process complete
Should the exesize of this source with the final (registred version of blitzmax) really just only 2657 byte?? What do you think about the speed vs pure?



Edit:
There is a RadialBlur source (original by Nehe, Tutorial 36) as BlitzMax version included! The original c++ exe is 36.864 bytes where the blitzmax compier info window display "3 passes, 11171 bytes." :roll:


The only one i dont really like, is OGL! I preffer to use DX for Windows! (Fred, you are on the right way ;)

Posted: Sun May 22, 2005 10:05 pm
by Num3
Well executables are a bit bigger than PB ones, much because of the libraries that need import...

Posted: Sun May 22, 2005 10:06 pm
by thefool

Code: Select all

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()
this is what i converted [correct me if im wrong, havent ever looked at a blitz code before]

Posted: Sun May 22, 2005 10:13 pm
by Pupil

Code: Select all

flat assembler  version 1.51
3 passes, 2657 bytes. 
The info that is displayed is just the output of the assembler, which apparently has generated an objectfile of size 2657 bytes. This info is not a good indicator of how big the final exe is going to be as the linker may add quite a lot of other objectfiles into the mix..

Re: BlitzMax for Windows

Posted: Sun May 22, 2005 10:34 pm
by traumatic
va!n wrote:Edit:
There is a RadialBlur source (original by Nehe, Tutorial 36) as BlitzMax version included! The original c++ exe is 36.864 bytes where the blitzmax compier info window display "3 passes, 11171 bytes." :roll:
I don't know BlitzMax and don't want to :) but the 'original' executable isn't
optimized for size. The exe will be <= 12kb in both C/C++ and PB if done
well as this is almost only about calling external functions (opengl32.dll).

Mark would have done a pretty bad job if his executables were bigger. ;)

Posted: Sun May 22, 2005 10:35 pm
by LuCiFeR[SD]
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.
Building test
Compiling:test.bmx
flat assembler version 1.51
3 passes, 2657 bytes.
Linking:test.exe
Executing:test.exe
SIEVE OF ERATOSTHENES - 10000 iterations
1000 iterations took 0.862999976 seconds.
Primes: 1899

Process complete
PB's code produced this:
SIEVE OF ERATOSTHENES - 10000 iterations
10000 iterations took 2.609000 seconds.
Primes: 1899
in both cases the debuger was off.

But tests like this really mean nothing. Although the numbers seem to say otherwise.

edit:

My system Specs:

OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
Processor: AMD64 2800
Ram: 1GB

Posted: Sun May 22, 2005 10:41 pm
by thefool
i did also get about same speeds..
but the compiled PB file is only 7kbyte...

does blitzmax allow for inline asm?

also, it might be specially optimized so this test would go fast (evil developers could do that hehe).. some other tests should be done..

Re: BlitzMax for Windows

Posted: Sun May 22, 2005 10:44 pm
by va!n
@Pupil
thanks for the info. I didnt know that its only for the generated obj file without the needed routines (sure, all the needed and even unused routines seems to be linked as a big packet to the executeable as the first pc version of blitz did it - really bad and sad!

@traumatic
hehe... *grin* you are right...

@thefool
i think fred is doing a nice job wiht pure :D
About including asm in blitz, i think yes it will be supported...!?

Code: Select all

Enhanced BASIC language
BlitzMax is BASIC...but with a few twists, including:

    * Function pointers
    * Fully dynamic arrays
    * Inheritance and polymorphism
    * 'By reference' function parameters
    * Byte, Short, Int, Long, Float and Double numeric data types
    * Array and string slicing
    * Flexible 'collection' system for dealing with linked lists etc
    * Low level pointer handling
    * UTF16 strings
    * The ability to 'Incbin' binary data and access it as easily as if it were a regular file
    * External language support for interfacing with C/C++/ObjectiveC or assembly code 

Posted: Sun May 22, 2005 10:47 pm
by LuCiFeR[SD]
not inline asm as such... but you can include asm files :)

Re: BlitzMax for Windows

Posted: Sun May 22, 2005 10:48 pm
by traumatic
I read somewhere that you could chose what modules (libraries?) to include
in order to reduce executable size. Maybe someone who actually bought
BlitzMax knows more.

Regarding inline ASM, is it true you can use 'inline C' ?

Posted: Sun May 22, 2005 10:53 pm
by LuCiFeR[SD]
yes you can INCLUDE C :). You can, with a bit of messing around make your exe's a lot smaller by taking out the bits you don't use from the modules. but in all honesty... exe size isn't exactly the be all and end all of programming. If you get an uber small exe it is just like penis envy... except you are "erm, extracting the urine" out of the guy for having a bigger penis lol :)

Re: BlitzMax for Windows

Posted: Sun May 22, 2005 10:54 pm
by va!n
Regarding inline ASM, is it true you can use 'inline C' ?
yes, as i heared and the website says... BlitzMax seems to support InlineASM and Inline C and compiled OBJ files...!?

Posted: Sun May 22, 2005 10:56 pm
by traumatic
LuCiFeR[SD], see, I already ordered a new Porsche so that's not the problem. ;)


...please keep in mind also underage persons read this forums

Posted: Sun May 22, 2005 10:58 pm
by va!n
:lol:

Posted: Sun May 22, 2005 10:58 pm
by LuCiFeR[SD]
Good point traumatic... my appologies for any offense. hahaha, Damn, I have a honda... so I must have a small, erm, thing lol