Raised This Month: $ Target: $400
 0% 

attempting to optimize code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-31-2016 , 11:37   Re: attempting to optimize code
Reply With Quote #8

Quote:
Originally Posted by siriusmd99 View Post
yes?

how plugin works:

death - is_alive[id] = false;
disconnect is_alive[id] = false;
spawn - is_alive[id] = true;

native_is_user_alive(id)
return is_alive(id)


when you use is_user_alive(id), don't you get already cached value?

the thing is that when you use is_alive , you acces global array from plugin but when you call native is_user_alive, you call array from module, which is faster.
https://forums.alliedmods.net/showthread.php?t=162735
https://forums.alliedmods.net/showth...hlight=Caching
https://forums.alliedmods.net/showthread.php?t=88792
__________________
JusTGo 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 18:39.


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