[HELP] Need some optimization tips for my server xD
#1

Hello guys. My server it's scripted pretty well... on 250 players i don't have any lag but i'm asking for some optimization tips. Please post here all your sugestions I'm using MySQL plugin R38.

Reply
#2

https://sampforum.blast.hk/showthread.php?tid=486877

you can use this and included tutorials
Reply
#3

We are not really able to say what you need to improve by your server to have full optimization, but here are some "general".

A) If you have tons of arrays, scroll through them and see which you can assign together. It reduces memory.
B) If your array dosen't use negetive values, and is lesser then a value of 128 I believe, pack it! [128 char];
C) Unix timestamps, always better then useless timers when they only need to be run once.
D) Reduce memory by reducing strings. Strings that you place under 128 cells are using only 20? Reduce them towards 20 and add a 1 for the null integer/closer.

Anything else, you can view by the one who posted above me.
Reply
#4

Excepting the using of rBit i'm already using all the other things
Reply
#5

Well, this is for extermly advanced PAWN scripters.
-> Replace any small/big stocks/functions/publics/anything that you feel that it should be with #emit.
#emit is the complier inside PAWN itself, it is quite faster. But its hard.

Besides that, you could optimize any for/while/foreach loops, and that should be it.
Reply
#6

rBit really isn't that useful unless you really have a ton of variables. For some reason I can't imagine a stunt server needing a ton of variables. I'd rather trade in memory for speed than the other way around. Bit operations take time, barely noticeable time, but time nonetheless.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
rBit really isn't that useful unless you really have a ton of variables. For some reason I can't imagine a stunt server needing a ton of variables. I'd rather trade in memory for speed than the other way around. Bit operations take time, barely noticeable time, but time nonetheless.
Thanks ****** for this advice. Can you provide me some usefull libraries ?

You should visit my stunt server and test some of it's features xD It's not a "simple" stunt server
Reply
#8

I'm using #emit on the main function i use it the most: InfoTD_MSG xD I will take a look on the other posts and maybe i will learn something new.
Reply
#9

Quote:
Originally Posted by nGen.SoNNy
Посмотреть сообщение
I'm using #emit on the main function i use it the most: InfoTD_MSG xD I will take a look on the other posts and maybe i will learn something new.
#emit is designed to bypass PAWN limitations and not designed for optimization purposes. Using it will not make your code any faster, since the PAWN compiler generates it anyway.

However, for optimization, use less timers. Swap certain timers for unix timestamps, lower string sizes, etc. If you use any SQL based database system, you could try optimizing or threading queries.

This thread covers most aspects of code optimization, you should read it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)