Raised This Month: $ Target: $400
 0% 

Optimization


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 01-23-2017 , 16:18   Re: Optimization
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
PHP Code:
haveTheFlag(index,id 0)
    return 
bool:(get_user_flags(index) & id
I may be wrong here but I think this creates some kind of internal call to a stock function which will in some way eat more resources. However I do not think this is reason for avoidance. If it makes things easier and cleaner it's the right way to go. But I don't think one native call is enough to create a stock.

Quote:
Originally Posted by EFFx View Post
PHP Code:
#define haveTheFlag(%1,%2) (get_user_flags(%1) & %2) 
This is basically copy-paste. The compiler will find all instances of "haveTheFlag" and just replace them with whatever is to the right of it. It will have no effect what so ever on the performance compared to writing it as usual since it is exactly the same.

I did som efficiency tests using 5 different methods.
Spoiler: None of them are sticking out as bad, they are all fine.
Spoiler
__________________

Last edited by Black Rose; 01-23-2017 at 16:31.
Black Rose is offline
 



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 20:50.


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