Loops Question
#1

Hello All,

Whats better?
One big loop or multiple small loops?
I need this because i am using much variables as timers.
I need to fix the lag in my server.

Thanks Admigo
Reply
#2

One big loop.
About Timers the case is different ( more smaller timers, and make sure they are not executing at same time ).
Reply
#3

What stuff can make your server slower like: Players moving bad or chat is sending the message slower?
Because this is my problem with my server. After playing like 10 minutes that lag will be in server.
Reply
#4

Quote:
Originally Posted by admigo
Посмотреть сообщение
What stuff can make your server slower like: Players moving bad or chat is sending the message slower?
Because this is my problem with my server. After playing like 10 minutes that lag will be in server.
If it's not due to your / host connection - I would go with smaller loops that are in separate functions that are spaced from each other a little
Reply
#5

It really depends on the amount of iterations in your loop and the stuff you do inside it. Do not place stuff under OnPlayerUpdate without any form of scheduling code. (only if you know what your doing). If you execute certain loops on a regular interval I'd say having multiple smaller loops is better because there'd be gaps in between where the server can do something else.
Reply
#6

Does a loop needs to have a return 1 or 0?
I have much incoming connections.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)