![]() |
|
LVP 2.93 - What needs to happen? - Printable Version +- Las Venturas Playground (https://forum.sa-mp.nl) +-- Forum: Main Talk (https://forum.sa-mp.nl/forum-3.html) +--- Forum: Development (https://forum.sa-mp.nl/forum-16.html) +--- Thread: LVP 2.93 - What needs to happen? (/thread-25563.html) |
LVP 2.93 - What needs to happen? - Matthias - 11-06-2010 http://trac.sa-mp.nl/lvp/ticket/300 http://trac.sa-mp.nl/lvp/ticket/127 http://trac.sa-mp.nl/lvp/ticket/305 http://trac.sa-mp.nl/lvp/ticket/306 These tickets definitly need to happen before we can update to LVP 2.93. This time everything has to be tested thoroughly on the main settings as well. The entire gang system has to be checked for optimizing as well. If I forgot anything on the list or if you have a suggestion, please reply in this topic. Matthias Re: LVP 2.93 - What needs to happen? - Jay - 11-06-2010 Fixed #305 already ![]() I think before we work on these tickets we need to address the amount of queries and unoptimized functions contained within the user/gang handler. * CheckUserExists - Function that gets called at least 3 times when a player connects, and once in the gang handler. This performs a query to clarify if a player is registered. This should only perform the query once and store the result in a variable. = DONE * Profile IDs in the gang handler - This performs a query to determine a players profile ID and stores it to a variable when they connect in the gang handler. This already happens in the user handler and is stored to the PlayerInfo[playerid][playerProfile] variable, which we can use. * Gang handler initialization. I'm going to quote the code for this: Code: #define CUR_TURFS 102* CGang: layerConnect - This function is called from OnPlayerConnect and checks if a player is in a gang and updates all relevant information for the player. Surely this should be called when the player logs in!- DONE * mysql_free_result is called prior to every mysql_store_result function call. No idea why. - DONE * CGang__GetNumberOfGangs() - This performs a query to get the result. Surely this can be stored in a variable. * CGang__IsPlayerGangLeader(playerid) see above * CGang__GetGangMoney(gangid) - see above Re: LVP 2.93 - What needs to happen? - Jay - 11-06-2010 [b]Before:[/b] Code: public CGang__ReloadGangData()* Performing 400 queries. * Called in the initialization function which currently does another 300, totaling 700 queries on initialization. * Called in 3 other gang commands. [b]After:[/b] Code: public CGang__ReloadGangData( iPhase )* Performs 1, threaded query * Is called only once, on initialization. No longer needs to be called from gang commands * Probably about 500% faster -- That's just an example of how one of the functions can be HIGHLY optimized. thiaZ, read and learn! P.S Blame the forum for the indention Re: LVP 2.93 - What needs to happen? - MrBondt - 11-06-2010 (11-06-2010, 02:36 PM)Jay link Wrote: P.S Blame the forum for the indentionWhy are you using tabs and spaces together? Re: LVP 2.93 - What needs to happen? - Jay - 11-06-2010 Just a copy + paste, habit I guess. |