Raised This Month: $ Target: $400
 0% 

Plugin Optimization Help KeyValues


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 04-25-2010 , 10:31   Re: Plugin Optimization Help KeyValues
Reply With Quote #4

When using a (external or local) SQL DB I would also cache the players' settings instead of just reading from the DB every time. You can store data in a structure like this:

PHP Code:
enum PlayerSettings
{
    
bool:PlayerSettings_InUse,
    
PlayerSettings_SomeVar,
    
String:PlayerSettings_SomeString[32],
    
Float:PlayerSettings_SomeFloat
}

new 
PlayerSettingCache[MAXPLAYERS 1][PlayerSettings]; 
Then you can cache DB results in structures like these when players connect, and write it back to DB when they leave.

About benchmarking, SourceMod have a profiler, but it's a alpha version. It did work fine when I tested it though: http://wiki.alliedmods.net/SourceMod_Profiler

The profiler will measure the time spent in each event and forward. If you want to measure specific stuff you can use the profiler API in SourceMod: http://docs.sourcemod.net/api/index....oad=file&id=18
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
 



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 07:09.


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