Raised This Month: $ Target: $400
 0% 

is worth and possible cache user ip and auth in index as global string var?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
seriousspot
BANNED
Join Date: Mar 2013
Location: Lithuania / Norway
Old 08-03-2013 , 12:48   is worth and possible cache user ip and auth in index as global string var?
Reply With Quote #1

Well i got my custom plugin its about 4k lines and i thinking about few simple optimisations so get_user_ip and get_user_authid exists in 11 functions its useless to getting same results for same id everytime its called. As far i have done research that calling such things may cause cpu usage, why just don't save it to memory for every player index, on client putinserver event it could be cached to an string variable, as player disconnect called client disconnect event, the ip and authid will be reseted to zero. Also its impossible that authid or ip can be changed in realtime @server.


Okay for the questions..

Is this worth (i see less cpu chokes, slutters, less cpu usage)?

Is this possible (cache ip and auth in player index (global string variable))?

I know that this will use a bit more memory, can i expect memory garbages?

Last edited by seriousspot; 08-03-2013 at 12:51.
seriousspot 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 15:58.


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