It is currently Mon Jun 24, 2019 7:17 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Fri Jun 15, 2018 2:07 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jul 07, 2013 11:35 am
Posts: 400
Location: Canada
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 !


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Fri Jun 15, 2018 2:50 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 531
Location: Belgium
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 -
http://www.marc-systems.be
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Fri Jun 15, 2018 2:57 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 198
Location: Germany
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 :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Fri Jun 15, 2018 3:12 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Fri Jun 15, 2018 4:32 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1770
Location: Pas-de-Calais, France
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...


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Sat Jun 16, 2018 10:54 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1257
Location: England
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Sat Jun 16, 2018 11:36 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jul 03, 2003 6:53 pm
Posts: 1257
Location: England
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Sat Jun 16, 2018 2:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 09, 2011 8:58 am
Posts: 445
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.

_________________
Warning - Proud GOTO lover ahead!


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Mon Jun 18, 2018 8:26 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed May 15, 2013 8:26 am
Posts: 141
Location: Czech Republic, Prague
firace wrote:
Could you post the SpiderBasic code too?


Yes, of course...

Code:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Mon Jun 18, 2018 5:59 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 09, 2011 8:58 am
Posts: 445
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.

_________________
Warning - Proud GOTO lover ahead!


Top
 Profile  
Reply with quote  
 Post subject: Re: Speed of Pure & Spider comparsion
PostPosted: Tue Jun 19, 2018 6:49 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 100
sounds like the string-"problem"
https://www.purebasic.fr/english/viewtopic.php?f=3&t=58892


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye