Raised This Month: $12 Target: $400
 3% 

Which is more efficient?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 08-20-2016 , 15:19   Which is more efficient?
Reply With Quote #1

Let's use a 'Hello World' as an example, printing a message in console on connect. Which is more efficient? An actual amxx plugin that does that or a metamod plugin (module)?
redivcram is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 08-20-2016 , 15:22   Re: Which is more efficient?
Reply With Quote #2

Metamod modules will always be faster.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 08-20-2016 , 15:54   Re: Which is more efficient?
Reply With Quote #3

Great then.
redivcram is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-20-2016 , 15:59   Re: Which is more efficient?
Reply With Quote #4

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Metamod modules will always be faster.
Be careful when saying always. Because you can always write crap code on Deterministic Turing Machines languages.
It is mathematically proved, does not matter how you try to create a super language, if the language is Turing Machines based, and the programmer want to, he may always write crap code.
So, a bad coded module to print "Help world!" or whatever other code, would be slower than a well coded AMXX plugin.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-20-2016 at 16:29. Reason: update
addons_zz is offline
Solokiller
Senior Member
Join Date: Sep 2015
Old 08-20-2016 , 18:02   Re: Which is more efficient?
Reply With Quote #5

Unless you're writing some Java-like abstract factory instantiation code to create a hello world printer, C/C++ will always be faster than Pawn scripts. The code required to print to console in a script encompasses everything that is needed in a C/C++ program that does that, and then some.

Last edited by Solokiller; 08-20-2016 at 18:03.
Solokiller is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 08-20-2016 , 18:10   Re: Which is more efficient?
Reply With Quote #6

Quote:
Originally Posted by redivcram View Post
Great then.
Metamod it's more faster, but it's useles depends on what you're trying to do. If you think that's will motivate you to learn metamod coding you're wrong. And also doing hard stuffs with metamod when you can make them with amxx scripting it's realy wrong.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-20-2016 , 20:47   Re: Which is more efficient?
Reply With Quote #7

Quote:
Originally Posted by Craxor View Post
Metamod it's more faster, but it's useles depends on what you're trying to do. If you think that's will motivate you to learn metamod coding you're wrong. And also doing hard stuffs with metamod when you can make them with amxx scripting it's realy wrong.
That is the point the AMXX, to keep things faster and easier to code. The same applies to your computer programs.
You do not need a Operating System as Windows, Linux, Mac OS, to run programs on your computer.
You can write programs to run straight you the computer's machine hardware.

But guess what, who does write code run on an pure machine?
Microsoft does that. Linux and Mac OS too.

But what they do?
A programmer friendly program (Called Operating System) which allows ordinary computer programmers to easily create and run programs on it.
So, instead of the computer programmer to deal by himself within the computer machine hardware, they write code to run on a friendly interface system program called Operating System.

Then some folks like to write code to Windows OS, other to Linux, others like to write code able to run on both platforms Also Know As the program which allows to run programs on it (using the Operating System API) to control the hardware as your computer monitor screen, printer, hard-disk, etc, instead of let the programmer to deal with the hardware by himself every time he want to do something as put a text on the screen.
So, the programmer just needs to call the operating system to do it. Which is several degrees easier to the programmer, then to deal with the hardware every time.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-21-2016 at 16:20. Reason: misspelling
addons_zz is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 08-21-2016 , 05:20   Re: Which is more efficient?
Reply With Quote #8

Quote:
Originally Posted by addons_zz View Post
That is the point the AMXX, to keep things faster and easier to code.
Current pawn is easy language, but not fast to write code and not good to read code, we need SourcePawn C#-like transitional syntax in Pawn to code faster and easier to read (and also it has more beautiful code). Also we need more comfortable functions/syntax to work with math vectors (in C++/C# you can use operator overloading for them).
__________________

Last edited by PRoSToTeM@; 08-21-2016 at 05:21.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-21-2016 , 14:24   Re: Which is more efficient?
Reply With Quote #9

Quote:
Originally Posted by PRoSToTeM@ View Post
Current pawn is easy language, but not fast to write code and not good to read code, we need SourcePawn C#-like transitional syntax in Pawn to code faster and easier to read (and also it has more beautiful code). Also we need more comfortable functions/syntax to work with math vectors (in C++/C# you can use operator overloading for them).
That is entirely an opinion. There is nothing preventing you from writing good, readable code in Pawn and doing it quickly.

C++ and C# are higher level languages. There are tradeoffs for using higher level languages. There is no way to say that one language is better than another. There may be some languages better suited to specific use cases.
__________________
fysiks is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 08-21-2016 , 18:12   Re: Which is more efficient?
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
There is nothing preventing you from writing good, readable code in Pawn and doing it quickly.
Try write good and readable code that use math vectors in Pawn quickly. This is neither readable nor quickly to write.

For example, in C++ with Vector class:
PHP Code:
pev->origin gpGlobals->v_forward 10 
And in AMXX Pawn with XS Library:
PHP Code:
new Float:origin[3];
pev(entpev_originorigin);

new 
Float:forward[3];
global_get(glb_v_forwardforward);
xs_vec_mul_scalar(forward10.0forward);

xs_vec_add(originforwardorigin); 
1 line vs 6 lines (not quickly) and in Pawn we can't see clear formula (not readable). But that is very simple example...

Also you can use array returning functions, but this is also not readable and not quickly to write:
PHP Code:
VectorAdd(PevVec(clientEntIndexpev_origin), VectorScale(AngleVector(PevVec(clientEntIndexpev_v_angle), ANGLEVECTOR_FORWARD), 64.0)) 
Original formula:
PHP Code:
MakeVectors(v_angle)
origin forward 64 
Another example: try to write code using structures via enums. There are problems with enums like problem with tagging or problem with field naming.
__________________

Last edited by PRoSToTeM@; 08-21-2016 at 18:21.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode