Raised This Month: $ Target: $400
 0% 

[Solved] How to optimize ?


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-20-2012 , 19:09   Re: How to optimize ?
Reply With Quote #11

PHP Code:
if( zp_is_swarm_round() ||
    
zp_is_plague_round() ||
    
zp_is_survivor_round() ||
    
zp_is_nemesis_round() ||
    
zp_is_lnj_round() ||
    
zp_is_sniper_round() ||
    
zp_is_assassin_round() )
{
    return;

__________________
Bugsy is offline
Swaycher
Senior Member
Join Date: Feb 2009
Location: Arg/MyHome/PawnStudio
Old 07-20-2012 , 21:03   Re: How to optimize ?
Reply With Quote #12

PHP Code:
if (zp_is_swarm_round() || zp_is_plague_round() || zp_is_survivor_round() || zp_is_nemesis_round() || zp_is_lnj_round() || zp_is_sniper_round() || zp_is_assassin_round()) 
    return 
__________________
Quote:
Originally Posted by fearAR View Post
Claro esta que no tengo idea de como verificar los diferentes cortes de ángulo.
http://forums.alliedmods.net/showthread.php?t=196349
Swaycher is offline
Send a message via MSN to Swaycher Send a message via Skype™ to Swaycher
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-20-2012 , 21:33   Re: How to optimize ?
Reply With Quote #13

Correct way to optimize:

Create native for zp_roundtype (should return integer value for the corresponding round type)

Check integer against the corresponding round values.

1 native call vs 7 native calls.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-20-2012 , 22:17   Re: How to optimize ?
Reply With Quote #14

Quote:
Originally Posted by Swaycher View Post
PHP Code:
if (zp_is_swarm_round() || zp_is_plague_round() || zp_is_survivor_round() || zp_is_nemesis_round() || zp_is_lnj_round() || zp_is_sniper_round() || zp_is_assassin_round()) 
    return 
Why would you post the same exact code that I did?
__________________
Bugsy is offline
Swaycher
Senior Member
Join Date: Feb 2009
Location: Arg/MyHome/PawnStudio
Old 07-20-2012 , 23:48   Re: How to optimize ?
Reply With Quote #15

Quote:
Originally Posted by Bugsy View Post
Why would you post the same exact code that I did?
because you used unnecessary things. ex: brackets and too more unnecessary lines.
__________________
Quote:
Originally Posted by fearAR View Post
Claro esta que no tengo idea de como verificar los diferentes cortes de ángulo.
http://forums.alliedmods.net/showthread.php?t=196349
Swaycher is offline
Send a message via MSN to Swaycher Send a message via Skype™ to Swaycher
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-20-2012 , 23:49   Re: How to optimize ?
Reply With Quote #16

Quote:
Originally Posted by Swaycher View Post
because you used unnecessary things. ex: brackets and too more unnecessary lines.
The purpose is to make the code easier to read, chief. No impact on performance or binary size.
__________________
Bugsy is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 07-21-2012 , 00:53   Re: How to optimize ?
Reply With Quote #17

Quote:
Originally Posted by Swaycher View Post
because you used unnecessary things. ex: brackets and too more unnecessary lines.
A bracket and a line will not burn your computer, these "details" are only for readability for both (the coder and the compiler)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-21-2012 , 05:33   Re: How to optimize ?
Reply With Quote #18

Quote:
Originally Posted by Emp` View Post
Correct way to optimize:

Create native for zp_roundtype (should return integer value for the corresponding round type)

Check integer against the corresponding round values.

1 native call vs 7 native calls.
You can even remove ZP from your server
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 07-21-2012 , 17:22   Re: How to optimize ?
Reply With Quote #19

Thanks Bugsy, works! ;)
& Thanks to all!
__________________




Last edited by pacheco; 07-21-2012 at 17:22.
pacheco is offline
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 12:14.


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