AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Decreasing amount of lag (https://forums.alliedmods.net/showthread.php?t=77328)

atomen 09-10-2008 13:04

Decreasing amount of lag
 
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

danielkza 09-10-2008 13:16

Re: Decreasing amount of lag
 
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.

atomen 09-10-2008 14:05

Re: Decreasing amount of lag
 
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?

danielkza 09-10-2008 14:31

Re: Decreasing amount of lag
 
Quote:

Originally Posted by atomen (Post 684029)
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.

atomen 09-10-2008 15:17

Re: Decreasing amount of lag
 
I'm using fVault which is using the new file system.
I previously used the old file system but that to gave me lag.

YamiKaitou 09-10-2008 15:20

Re: Decreasing amount of lag
 
Try using SQLite or nVault.

zwfgdlc 09-10-2008 15:28

Re: Decreasing amount of lag
 
CPU is overoccupied?

atomen 09-10-2008 15:50

Re: Decreasing amount of lag
 
Quote:

Originally Posted by YamiKaitou (Post 684055)
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.

YamiKaitou 09-10-2008 16:17

Re: Decreasing amount of lag
 
Have you tried using MySQL or SQLite yet?

atomen 09-10-2008 16:33

Re: Decreasing amount of lag
 
Quote:

Originally Posted by YamiKaitou (Post 684076)
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.


All times are GMT -4. The time now is 03:16.

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