Page 1 of 1

Perhaps NeoBook needs steroids....

PostPosted: Sat Mar 07, 2009 12:29 am
by David de Argentina
Hi all,

I did the same test on several languajes in order to know perfomances.

the Neobook Script is the following:

Code: Select all
setvar "[x]" "1"
setvar "[y]" "1.0000001"
TimerStart "Cronometro1" "5000"

Loop "1" "100000000" "[i]"
  math "[x]*[y]" "-1" "[x]"

TimerStop "Cronometro1"

. [timer] is the variable to get the interval of the Timer Object
alertbox "" "[timer]"

Visual Basic 6 do the test in 3.469 secs.
Powerbasic do the test in 0.206 secs.
NeoBook ... after 2 minutes with the CPU at 100%... I decided cancel the test...

Are there a good pharmacy near Oregon ? :lol:

Greetings from Buenos Aires,
David de Argentina

PostPosted: Sat Mar 07, 2009 12:38 am
by HPW
Is it fair to compare interpreted vs. compiled?

PostPosted: Sat Mar 07, 2009 12:45 am
by David de Argentina
Hi Hans-Peter,

No, compiled vs compiled.

X and Y variables are defined as Floating-Point extended presition
Timer is Floating-Point single presition

PostPosted: Sat Mar 07, 2009 12:52 am
by David de Argentina
Sample is based on this article:

I think there is interesting know how about this test using Delphi

Greetings from Buenos Aires,
David de Argentina

PostPosted: Sat Mar 07, 2009 3:17 am
by HPW
No, compiled vs compiled.

Nope. neobook is never compiled. It does not produce native mashine code.
The 'compile'-process bind the neobook runtime with the contained scripts amd the scripts gets feeded into the interpreter.
When you do not encrypt on 'compile' you can see the script with a hex-viewer.
So in fact neobook is not a real compiler (in the pure sense).

As always: Use the right tool to get the job done.

So neobook for GUI-Scripting and others via plugins for number-crunching.

PostPosted: Sat Mar 07, 2009 4:21 am
by HPW
I think there is interesting know how about this test using Delphi

Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
    start,stop,time, I : integer;
    x,y  : Double;
  x :=  1;
  y :=  1.0000001;
  start := GetTickCount;
  for I := 1 to 100000000 do
     x := x * y ;
  stop := GetTickCount;
  time := stop-start;
  Label1.Caption := 'Needed time '+ IntToStr(time) + ' ms';

Delphi 7/Win XP on a P4 1.8 GHZ: ~1750 ms
On a Vista Laptop Core 2 Duo P8400 2.26 GHZ: ~ 800 ms

PS: I know that PB produce fast code since I own a PB WIN for a long time now.

PostPosted: Sat Mar 07, 2009 7:02 am
by Gaev
David de Argentina:

That was a good academic exercise ... but here are some considerations when selecting a "the right tool for the job" (copyright HPW :wink: ) ...

1) the Loop/EndLoop (and similar While/EndWhile) code blocks are the the only instances where I have found a noticeable (run time) response that is wanting in NeoBook ... and only with a significant number of iterations.

2) perhaps you can do a similar test ... only, instead of a math "[x]*[y]" "-1" "[x]" command inside the loop, do something that reads/writes files ... the differences should be less pronounced.

3) since most applications do not require perforing Prime Number or Factorial type calculations, the choice of "right tool" should include other considerations ... for me ...

- Rapid Application Development
- Ease of Development (and fun)
- Product with miniscule number of defects
- Prompt response from Dave when problems are encountered
- Ability to have direct input to future enhancements

... all trump the one or two instances where other tools out perform NeoBook.

Comparing PowerBasic and Delphi ... 100 million iterations in 200 milliseconds vs. 800 milliseconds ... proves the point that for 99.999% of Desktop Applications, speed of execution is no longer an issue/consideration ... even Intel stopped pouring money into faster processors ... and focused on multi-core architectures instead.

Its like comparing 2 sports cars ... one can travel at 300 km/hour and another at 600 km/hour ... but if you use your car to travel within a large city (maximum speed 100 km/hour), all you get with a faster rated car is "bragging rights" ... I would rather have a less expensive car that is safe, comfortable and reliable.