SA-MP Forums Archive
#pragma dynamic - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: #pragma dynamic (/showthread.php?tid=551647)



#pragma dynamic - Banditukas - 20.12.2014

Hi,

I'am using now 5000000 pragma dynamic. Is it slow a server?


Re: #pragma dynamic - Vince - 20.12.2014

Not directly, but the mere fact that you need to use this directive is usually an indication that the script you are using is an unoptimized mess.


Re: #pragma dynamic - Banditukas - 20.12.2014

BUt sometimes, you do that that you don't see and there use a lot of memory for ex somebody say if you return string it'is use a lot of memory

Код:
stock asdsad (variable[])
{
return variable;
}
And something similar.


Re: #pragma dynamic - Ryz - 20.12.2014

This much! try to optimize your scripting. Looks like you scripted something big thing poorly


Re: #pragma dynamic - PowerPC603 - 20.12.2014

Are you returning strings up to 5 megabytes in size?

You gotta optimize your code in that case, not increase the #pragma dynamic.
Most scripts don't use it, as the default stack is big enough in most cases (like 99% of all possible cases).
Even big scripts which have over 50k lines don't need to adjust this value.

I also got some messages from heap/stack size in the beginning, but that was because I created big arrays inside functions.
Moving those big arrays to the main script (outside any function) got rid of those messages.


Re: #pragma dynamic - Banditukas - 20.12.2014

My script is 300 k lines and without includes.


Re: #pragma dynamic - Pottus - 20.12.2014

Quote:
Originally Posted by Banditukas
Посмотреть сообщение
My script is 300 k lines and without includes.
I don't think you have the capacity to write that much code let alone manage a code base of that size.


Re: #pragma dynamic - MafiaOink - 23.07.2018

SHOWING OFF GONE WRON AHAHAHA