DrawText high cpu / fps loss

hello,
did anyone else had this problem using native draw methods in fivem/gta5?
i tried many different ways to draw, even inside draw origins but when i draw (it doesnt matter how) my cpu time is increasing by ~2msec for each text. soo wtf is this normal?
like 5 texts inside a draw origin will cause around 10msec ~ -50fps or more. this is hella SHIT!
i also checked similar topics but i cant find any solution.

if there is no solution i’ll try NUI but i dont know if NUI are compatible with origins, probl. not.
i hope anyone can help.

i could post a tiny snippet but i used very common ways so thats should’nt be the issue.

You’re obviously doing something wrong if you’re getting 2ms increase, 2! Share your code, maybe?

it seems that assert() in repetitive functions is causing that issue.
i was type checking my parameters and that was my issue.
for real, i tried to fix this for hrs. thanks for the reply anyway.
maybe type checks in render classes (drawing methods) are too much.

Considering those draws should be done every frame, if you’re doing a bunch of for statements while doing so that can make the process much more demanding.

is there any way to analyze my memory in fivem?
im searching for performance guides but hard to find especially things about that 50+mb message.

try this

The profiler resource subcommands.

yeah i tried that but its not recording memory. in my case good to see which threads takes too much time.

Note ‘resource’, not ‘record’.