• Welcome to Vice City Multiplayer.
 

Squirrel

Started by Javi, February 07, 2010, 09:40:20 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Javi

Oh well, here's the speedtest anyways:

The scripts do the same operation, which is calculate a distance between 2 random 3d coordinates. It does the operation 500 times to give more accurate timings.

The code for both is here:

// Pawn

#include <a_vcmp>

main()
{
}



public OnGameModeInit()
{
new counter = GetTickCount();
new Float:distance = 0.0;
new output[ 128 ];
for ( new i = 0; i < 500; i++ )
{
CalculateDistance( distance, random( 2500 ), random( 2500 ), random( 2500 ), random( 2500 ), random( 2500 ), random( 2500 ) );
format( output, sizeof( output ), "Distance: %f", distance );
print( output );
}
new totalTime = GetTickCount() - counter;
format( output, sizeof( output ), "Time taken: %i", totalTime );
print( output );
return 1;
}

public CalculateDistance( &Float:ret, Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
ret = floatsqroot( ( ( x2-x1 ) * (x2-x1) ) + ( (y2-y1) * (y2-y1) ) + ( (z2-z1)*(z2-z1) ) );
return 1;
}

// Squirrel
function onScriptLoad( )
{
local counter = GetTickCount();
for ( local i = 0; i < 500; ++i )
{
print( "Distance: " + CalculateDistance( rand() % 2500, rand() % 2500, rand() % 2500, rand() % 2500, rand() % 2500, rand() % 2500 ) );
}
local timeTaken = GetTickCount() - counter;
print( "Time Taken: " + timeTaken );
}

function CalculateDistance( x1, y1, z1, x2, y2, z2 )
{
return sqrtf( ( ( x2-x1 ) * (x2-x1) ) + ( (y2-y1) * (y2-y1) ) + ( (z2-z1)*(z2-z1) ) );
}


And here's the result:


The times are in milliseconds. Shows how squirrel excels in floating point operations :)

SilenusShar

lol...would the real slim shady please stand up!

Boss

#62
Quote from: Forze on February 08, 2010, 08:06:12 PM
The times are in milliseconds. Shows how squirrel excels in floating point operations :)
SQ IS 20 MS FASTER??? OMG OMG
* Boss runs to switch to Squirrel.

Btw, Pawn spends extra time for string formatting. You also calculate sizeof(output) each time for some reason. :s

EDIT: That Pawn sample takes 200-270 ms for me to complete. How many computers are in your grid? :o

EDIT2: Removed the distance output. Now it takes 0 ms to complete. Your point about "fast float operations" fails.

[AoD]NC

This discussion is more and more pointless ;x. What was the orginal idea of this topic?

For some ppl squirrel is better, and for some Pawn and nobody cant change it :).

SilenusShar

#64
well, whoever the real coder is, they certainly did a good job in the end. why did it take them 5 pages though... :/

EDIT:
the topic was a request for squirrel in VC:MP. a dev needs to test that and then decide.


EDIT2:
Surely a better approach to your problem would be to create a topic stating the reasons you think squirrel is better then pawn, and why, providing evidence (just like you did above) where necessary.

Skirmant

And the winner is... *DRUM ROLL*
NONE! You guys wasted 5 pages on pointless arguing!
BTW! Pawno and Squirrel sucks! *Runs away*
I know advance mIRC, average C++, basic Pawn & Squirrel, very basic Java Script.

thijn

At this stage (As the servers are right now) squirrel has a lot more functions then the Pawno server. Although I hope the pawno server will atleast support plugins and more of these "basic" functions.


Boss

Quote from: thijn on February 08, 2010, 11:01:09 PM
squirrel has a lot more functions then the Pawno server
May we have a list please?

SilenusShar

thijn, learn this lesson in life. (or not, its up to you)

if you want to get your point accross to someone, make it a habbit to backup ALL claims/statistics you make with evidence.

E.g. if your quoting to the president that 23% of all americans wear blue socks, you must be sure this figure is accurate, providing solid proof to back it up.


ps, if that example is not close enough to home for you, i'll re explain with an example that is taylor made for you. :-)

gta5

I don't see the point of this topic, it's obvious that no one here are going to be persuaded one way or the other. Just use whatever method you prefer  :-* For me that's mirc ;D and I have few problems with lag. Yes, the scripts are on a separate pc than the server but that's not a problem.

Boss

Quote from: gta5 on February 08, 2010, 11:47:57 PM
Yes, the scripts are on a separate pc than the server but that's not a problem.
Maybe no mrc support will be a good enough problem for you?

gta5

#71
ya it would be but I don't need to worry about that yet  ::) sure it will eventually become unusable with vcmp or w/e but by the time it becomes unusable I probably won't be playing this, anyway I doubt it will become unusable in the near future and in my opinion there's no reason to cut off someone's resources for the sake of a few seconds lag.

Also, I have no reason to believe that mirc won't work all I have to base that on is your word

Boss

Quote from: gta5 on February 09, 2010, 12:04:05 AM
ya it would be but I don't need to worry about that yet  ::) sure it will eventually become unusable with vcmp or w/e but by the time it becomes unusable I probably won't be playing this, anyway I doubt it will become unusable in the near future and in my opinion there's no reason to cut off someone's resources for the sake of a few seconds lag.

Also, I have no reason to believe that mirc won't work all I have to base that on is your word
You do understand that you're rather naïve, don't you?

gta5

#73
I love you too  :-*


Jc18

#74
give what the ppl want!

anyway mirc > pawn,squirrel