[Best practice] Improve your resource performance

Press F8 and type ‘resmon 1’

Someone can help me to improve a script? If you can pm me plz :slight_smile:

1 Like

example with?
GetEntityCoords

Looking for the dev thankyou

Hi, what about low FPS when a lot of player nearby? do you have any idea? image shown below was the profiler record statistic


i dont know why, there is some delay after all script execution finished and next frame being started to be rendered (the white space between scripting ends and next frame begin)

this is what the profiler says, not using much CPU, but when players gather in pretty much close proximity, FPS drops to arround 40 fps (170 fps on Singleplayer)

1 Like

Do you have any ETW trace file (.etl) from the client or any sort of repro?

a) ‘singleplayer’ doesn’t have to render 100+ custom freemode peds at once on screen
b) and doesn’t run 5ms of custom scripts (wtf that’s a lot)

One of the most useful topics in this forum.
Good job man.

It does not matter if you combine them.You gotta check loops and make sure you are not making all the time a variable.

So after new updates, some server will receive a error message like this (I took the picture from Discord community and it’s not for me:

So I will appreciate it if developers of fivem tell us how fivem will calculate this because it’s a little complicated for me.

For example what tick time is best or what is new Column call “Time”

I’m not using any ESX or other frameworks, I’m using the original natives and my server has 35 resources and this is the resmon:

So is that good ?
The highest resource that usage CPU is HUD which is using 0.15 ms of CPU as you can see in the picture and I really don’t like to use GTA V DRAW TEXT because it occupies CPU usage more than other natives.

this has nothing to do with the servers but rather the team of the five m , I went back open my past servers that are completely different happens to us in vrp or as esx and it is random the message, i will probably emigrate platform, i set up 3 years developer in the five m and i almost give up.

EDIT: really is fivem error! people on the same server have the error, BUUUUUUUUUUUUUUUUUUT only for some people!!! how can you explain this? IS NOT SERVER PROBLEM JESUS I GONNA KILL MYSELF

I7 7700K WITH AMD RX 580 GET WARNINGS
i7 8700K WITH NVIDIA GTX 1080TI DONT HAVE WARNINGS
i5 9300H WITH NVIDIA RTX 2060 GET WARNINGS
I7 9750H WITH NVIDIA RTX 2060 GET WARNINGS
I5 9400F WITH NVIDIA GTX 1660 DONT HAVE WARNINGS
i5 4460K WITH NVIDIA GTX 750TI DONT HAVE WARNINGS
i7 7700HQ WITH NVIDIA GTX 1060 DONT HAVE WARNINGS

1 Like

Something else that is useful is using events. If you have multiple resources that check if a player is entering a car you could just have one resource that calls an event about the player entering a vehicle.

five m have fix it :+1:

FiveM hasn’t fixed anything, they just made the warning go away. Your resources are still poorly optimized

so how would one go about optimizing vmenu since its all dlls

Firstly, vMenu is already pretty well optimised. To answer your question, anyway, you’d need to edit the source code and then compile it.

thanks zee was just wondering cause it stays at 4ms for me and goes to 6ms with players maybe its just my cpu :man_shrugging: (its 2.3ghz)

This is some issue from your end, vMenu itself doesn’t run at such ms.

You are the best i managed to make my server playable at 60+ fps

Also a good optimization method is the following

before to something for a specific job
Check if the player has the job
If the player does not has the job tell the loop to wait

as i said might be my clock speeds performance varieties for different speeds

Yes brother, I am just confirming it.