ProjectFairnessLabs / PF-vMenu

PF-vMenu is a custom server sided trainer/menu, built using MenuAPI. It has full permissions support, so the server owner can decide who's allowed to do what.
https://discord.gg/D7cVc8TzPN
18 stars 11 forks source link

RegisterKeyMapping/RegisterCommand being run every tick #54

Closed Rqver closed 1 year ago

Rqver commented 1 year ago

Running the RegisterKeyMapping/RegisterCommand every tick will not be doing any favours at all to the performance of the resource, they only need to be ran once when the script is loaded. Would PR it but don't have access to an editor at the moment unfortunately - I imagine resmon would drop by 0.20+ by only running this once.

https://github.com/ProjectFairnessLabs/PF-vMenu/blob/c4b258650fde57bdf3563aca79618f3d04d32670/vMenu/MainMenu.cs#L506

RickyB505 commented 1 year ago

so its not as performance killing as you might think just did the test and its maybe 0.05

RickyB505 commented 1 year ago

with keymapping keymapping/commands removed

RickyB505 commented 1 year ago

thats with and without keymapping/commands

RickyB505 commented 1 year ago

and tbh they were both fluctuating around the same area so its probably even less that that

Rqver commented 1 year ago

Oh strange I ran some tests and got a very different result, maybe I only saw it when the script first started so it was still creating all the menus etc, regardless the natives don't need to be run every tick

RickyB505 commented 1 year ago

yeah ill fix it

RickyB505 commented 1 year ago

https://github.com/ProjectFairnessLabs/PF-vMenu/commit/12961e7303841cb41fc9c60ad947c963a62b9ee3