Raised This Month: $ Target: $400
 0% 

Decreasing amount of lag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 09-10-2008 , 13:04   Decreasing amount of lag
Reply With Quote #1

Hi!

I got a problem with my plugin, its extremely memory consuming
and creates lag after some time. I wonder if there are any 'tricks' to decrease
the amount of lag.

I've optimized my plugin as much as I can without any results.
I've also used "#pragma dynamic 32768" but that doesn't help.

I wonder if there a some kind of code snippet in the plugin which makes it lag.

Anything that could help would be appreciated.
Here's the link to the source code: LINK
__________________
atomen is offline
Send a message via MSN to atomen
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-10-2008 , 13:16   Re: Decreasing amount of lag
Reply With Quote #2

What about good coding practices? Tell us what you're doing, or at least post us part of the code so we can help you.
danielkza is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 09-10-2008 , 14:05   Re: Decreasing amount of lag
Reply With Quote #3

Well, it's the entire plugin really.
It's memory consuming and I can't find a way to decrease the amount of lag.

Though I'm pretty sure the lag starts when there are a lot of people in the database.
Since they also have to be sorted by there points.

Is there any better way of saving or optimization?
__________________
atomen is offline
Send a message via MSN to atomen
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-10-2008 , 14:31   Re: Decreasing amount of lag
Reply With Quote #4

Quote:
Originally Posted by atomen View Post
Well, it's the entire plugin really.
It's memory consuming and I can't find a way to decrease the amount of lag.

Though I'm pretty sure the lag starts when there are a lot of people in the database.
Since they also have to be sorted by there points.

Is there any better way of saving or optimization?
What kind of database are you using? An internal one? SQL, etc? We can't help you without information.
danielkza is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 09-10-2008 , 15:17   Re: Decreasing amount of lag
Reply With Quote #5

I'm using fVault which is using the new file system.
I previously used the old file system but that to gave me lag.
__________________
atomen is offline
Send a message via MSN to atomen
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-10-2008 , 15:20   Re: Decreasing amount of lag
Reply With Quote #6

Try using SQLite or nVault.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 09-10-2008 , 15:28   Re: Decreasing amount of lag
Reply With Quote #7

CPU is overoccupied?
zwfgdlc is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 09-10-2008 , 15:50   Re: Decreasing amount of lag
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
Try using SQLite or nVault.
Well I would use nVault, but there's is no way to return the amount of entries.
Nor return entrie by number. Example returning the 1st entry with fvault:
PHP Code:
for(new 115i++)
   
fvault_get_key(ikeylen); 
You probably understand what I mean.
There's not a function for that in nVault.
__________________
atomen is offline
Send a message via MSN to atomen
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-10-2008 , 16:17   Re: Decreasing amount of lag
Reply With Quote #9

Have you tried using MySQL or SQLite yet?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 09-10-2008 , 16:33   Re: Decreasing amount of lag
Reply With Quote #10

Quote:
Originally Posted by YamiKaitou View Post
Have you tried using MySQL or SQLite yet?
Well then it comes to access, not many people has access to a database.
Also, I don't have so much experience in it but that might be my only option.

Just a quick question, is it possible to create a database in mysql sorted by a value?
As I do in my current script, sort the database by the players points.
__________________
atomen is offline
Send a message via MSN to atomen
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 03:16.


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