Speed of Pure & Spider comparsion

Everything else that doesn't fall into one of the other PB categories.
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Speed of Pure & Spider comparsion

Post by StarBootics »

The original test on my computer with DisableDebugger and compiling without the debugger give me 9.695 seconds
The User_Russian's test with DisableDebugger and compiling without the debugger give me 4.406 seconds
The NicTheQuick's test with DisableDebugger and compiling without the debugger give me 0.260 seconds

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
marc_256
Enthusiast
Enthusiast
Posts: 744
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Speed of Pure & Spider comparsion

Post by marc_256 »

Hi,

I did some tests,
but I do not understand the results ?
I use PB 5.62 Final x64 on my old programming laptop ... I like this PC
If I start the program and check the taskmanager,
I see that PB is only using 23% of cpu time even when there is a lot of idle time ?

Why ?

Marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Speed of Pure & Spider comparsion

Post by Bitblazer »

marc_256 wrote:Hi,

I did some tests,
but I do not understand the results ?
I use PB 5.62 Final x64 on my old programming laptop ... I like this PC
If I start the program and check the taskmanager,
I see that PB is only using 23% of cpu time even when there is a lot of idle time ?

Why ?

Marc,
Sounds like a quadcore CPU with a software which utilitizes a single thread only. 3 of 4 cores cant participate so 25% would be the maximum you could get in the summary display. Switch do show each single core in a graph and see :)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Speed of Pure & Spider comparsion

Post by Trond »

The original code without the debugger (DisableDebugger shouldn't have an effect in this case):
13 758 ms

The original code, with the debugger and DisableDebugger:
13 916 ms

There is a small, but consistent difference. In other scenarios, there are actually big differences, especially when calling PB commands. When the debugger is turned off from the menu, the optimizer is turned on in the compiler (I think), and the library commands behave differently.

With debugger:
107 001 ms
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Speed of Pure & Spider comparsion

Post by djes »

Bitblazer wrote:
marc_256 wrote:Hi,

I did some tests,
but I do not understand the results ?
I use PB 5.62 Final x64 on my old programming laptop ... I like this PC
If I start the program and check the taskmanager,
I see that PB is only using 23% of cpu time even when there is a lot of idle time ?

Why ?

Marc,
Sounds like a quadcore CPU with a software which utilitizes a single thread only. 3 of 4 cores cant participate so 25% would be the maximum you could get in the summary display. Switch do show each single core in a graph and see :)
Maybe it's also the reason why JavaScript could be faster than a compiled program, parts of the js code being executed on different cores. Threading is then very important...
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Speed of Pure & Spider comparsion

Post by the.weavster »

Kiffi wrote:That makes me sceptical:
Yes, it would be interesting to see the JS code. JavaScript compilers use inference engines that ascertain the datatype of a variable when it's initialized. If you take FireFox for example, iirc there are three levels of execution:

Interpreter (Functions that are only run once)
Baseline compiler (Warm code - A quick compile to byte code)
IonMonkey compiler (Hot code - A further more optimized compile generated from the byte code of Baseline)

If you change the datatype of a variable in JS that's running in FireFox it can slow down execution a lot because that routine will get kicked back down to the interpreter even if it's hot code (i.e. a routine that's being called repeatedly during execution). SpiderBasic's type checking should prevent developers from falling into that trap.
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Speed of Pure & Spider comparsion

Post by the.weavster »

NicTheQuick wrote:It is impossible that Spiderbasic is faster than Go, C, C++, C# except your coding is bad.
I'm not saying it's the case in this instance but when Mozilla were experimenting with asm.js it did outperform C++ on a Binary Trees benchmark.

Details here
firace
Addict
Addict
Posts: 902
Joined: Wed Nov 09, 2011 8:58 am

Re: Speed of Pure & Spider comparsion

Post by firace »

Original code took 19s here (with debugger disabled from the menu).

Could you post the SpiderBasic code too?

Your test results are very surprising (Java and Go faster than C++??)

Note: Nicthequick's version completed in 0.2s.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 169
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Speed of Pure & Spider comparsion

Post by zxretrosoft »

firace wrote:Could you post the SpiderBasic code too?
Yes, of course...

Code: Select all

Global p.i
Global x.i=-1
Global a1.i,a2.i,a3.i
Global ps1.s,ps2.s,ps3.s
Global h1.s,h2.s,h3.s
Global h.i

Declare RenderFrame()

h1="L"
h2="W"
h3="K"
h=3724

RenderFrame()

Procedure RenderFrame()
  
 Repeat
  
x+1
p+1

If x>9999
    x=0
    a3+1
    If a3>25
        a3=0
        a2+1
        If a2>25
            a2=0
            a1+1
        EndIf
    EndIf
EndIf

Select a1
    Case 0
        ps1="A"
    Case 1
        ps1="B"
    Case 2
        ps1="C"
    Case 3
        ps1="D"
    Case 4
        ps1="E"
    Case 5
        ps1="F"
    Case 6
        ps1="G"
    Case 7
        ps1="H"
    Case 8
        ps1="I"
    Case 9
        ps1="J"
    Case 10
        ps1="K"
    Case 11
        ps1="L"
    Case 12
        ps1="M"
    Case 13
        ps1="N"
    Case 14
        ps1="O"
    Case 15
        ps1="P"
    Case 16
        ps1="Q"
    Case 17
        ps1="R"
    Case 18
        ps1="S"
    Case 19
        ps1="T"
    Case 20
        ps1="U"
    Case 21
        ps1="V"
    Case 22
        ps1="W"
    Case 23
        ps1="X"
    Case 24
        ps1="Y"
    Case 25
        ps1="Z"
EndSelect

Select a2
    Case 0
        ps2="A"
    Case 1
        ps2="B"
    Case 2
        ps2="C"
    Case 3
        ps2="D"
    Case 4
        ps2="E"
    Case 5
        ps2="F"
    Case 6
        ps2="G"
    Case 7
        ps2="H"
    Case 8
        ps2="I"
    Case 9
        ps2="J"
    Case 10
        ps2="K"
    Case 11
        ps2="L"
    Case 12
        ps2="M"
    Case 13
        ps2="N"
    Case 14
        ps2="O"
    Case 15
        ps2="P"
    Case 16
        ps2="Q"
    Case 17
        ps2="R"
    Case 18
        ps2="S"
    Case 19
        ps2="T"
    Case 20
        ps2="U"
    Case 21
        ps2="V"
    Case 22
        ps2="W"
    Case 23
        ps2="X"
    Case 24
        ps2="Y"
    Case 25
        ps2="Z"
EndSelect

Select a3
    Case 0
        ps3="A"
    Case 1
        ps3="B"
    Case 2
        ps3="C"
    Case 3
        ps3="D"
    Case 4
        ps3="E"
    Case 5
        ps3="F"
    Case 6
        ps3="G"
    Case 7
        ps3="H"
    Case 8
        ps3="I"
    Case 9
        ps3="J"
    Case 10
        ps3="K"
    Case 11
        ps3="L"
    Case 12
        ps3="M"
    Case 13
        ps3="N"
    Case 14
        ps3="O"
    Case 15
        ps3="P"
    Case 16
        ps3="Q"
    Case 17
        ps3="R"
    Case 18
        ps3="S"
    Case 19
        ps3="T"
    Case 20
        ps3="U"
    Case 21
        ps3="V"
    Case 22
        ps3="W"
    Case 23
        ps3="X"
    Case 24
        ps3="Y"
    Case 25
        ps3="Z"
EndSelect


Until h1=ps1 And h2=ps2 And h3=ps3 And h=x


Debug(p)


EndProcedure
I apologize in advance for bad English
https://zxretrosoft.cz/
firace
Addict
Addict
Posts: 902
Joined: Wed Nov 09, 2011 8:58 am

Re: Speed of Pure & Spider comparsion

Post by firace »

I confirm, SpiderBasic completes it in about 2 seconds.
Really surprising.

@Fred, if you could comment on this, it would be great :)


PS: I'm using Google Chrome on Win 10 x64.
Cyllceaux
Enthusiast
Enthusiast
Posts: 464
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: Speed of Pure & Spider comparsion

Post by Cyllceaux »

sounds like the string-"problem"
viewtopic.php?f=3&t=58892
Post Reply