Hello There, Guest! Login or Register


Optimizations
#1
Since we are aiming to run LVP on a 500 player server, we need to make some optimizations. As discussed in the development channel earlier, optimizations should have the highest priority.

Below is a list I've compiled of what I think should be done to optimize the gamemode (In order of priority):

* Use our own MySQL plugin with proper threaded callbacks (Badeend will do this)

* Remove every SetTimerEx statement. Features using SetTimerEx should just be handled from the main timers

* Remove the amount of global timers. Currently, there are 4 global timers. Three 1 second timers which use offsets to spread the load (unproven theory) and a minute timer. This should be reduced to one 1 second timer

* Optimize callbacks. OnPlayerKeyStateChange is an example callback which is called a lot. It contains ridiculous amounts of code, and has many unnecessary checks and loops

* Handle objects from a plugin. Peter already wrote an object plugin but is untested. We will have to excessively test it out once he adds it to the SVN Repo for performance. If this fails, I rewrote the current world object handler a few weeks back and optimized it. It has not been tested yet however.

* Enable and improve performance measuring. Add performance checks to many more functions, and only have it log down functions which need optimizing, instead of logging down every function. Where applicable, optimize functions that are showing to be slow and have bad performance.


* Remove Per second loops. So many functions which are called every second contain loops. I removed quite a few already for 2.90, but there are ~ 25 other loops being called every second. This should just be handled from one loop


Deadline: 18/09/2009

I can't do all of this alone (especially the plugin stuff :P) and I'm not going to be very active for the next coming days.
Despite me being less than half as active as I used to be when I was developing 2.90, it seems that I've been the only person to do work on LVP 2.91. 2.91 is in the 0.3 branch, along with the update a_samp.pwn includes. If you need the SA:MP 0.3 server and client, it's available in a stickied topic on the 0.3 scripting boards in the SA:MP forums.
Reply
#2
I'll create some seperate tickets for every of these points this afternoon, I'll do some of it myself too.
Reply
#3
(09-08-2009, 10:37 PM)Jay link Wrote: * Remove the amount of global timers. Currently, there are 4 global timers. Three 1 second timers which use offsets to spread the load (unproven theory) and a minute timer. This should be reduced to one 1 second timer
I'm not sure what good this will do. Sure, Y_Less' theory of spreading the load is unproven, but so is Peter's theory of doing everything at once. I'm going to have to side with Y_Less on this one, it just seems more logical to me as huge amounts of Pawn code are infinitely slower (and therefore queueing everything else the server has to do) than the low-level checks it takes to determine whether a timer should be executed.
Reply
#4
(09-11-2009, 11:13 AM)Pugwipe link Wrote: I'm not sure what good this will do. Sure, Y_Less' theory of spreading the load is unproven, but so is Peter's theory of doing everything at once. I'm going to have to side with Y_Less on this one, it just seems more logical to me as huge amounts of Pawn code are infinitely slower (and therefore queueing everything else the server has to do) than the low-level checks it takes to determine whether a timer should be executed.

We don't have to use additional timers to create offsets though :)
Reply