How many includes can I have? - 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)
+---- Forum: Discussion (
https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: How many includes can I have? (
/showthread.php?tid=645567)
How many includes can I have? -
RageCraftLV - 29.11.2017
So, I've been wondering, how many includes I can have in gamemode. While browsing includes section, I've found so many good includes, but will too many includes be bad for performance? Let's say that the includes are well optimized.
Re: How many includes can I have? -
Freaksken - 29.11.2017
An include is just pawn code that is copied into your script on compilation.
Re: How many includes can I have? -
Abagail - 29.11.2017
Quote:
Originally Posted by RageCraftLV
So, I've been wondering, how many includes I can have in gamemode. While browsing includes section, I've found so many good includes, but will too many includes be bad for performance? Let's say that the includes are well optimized.
|
Includes themselves don't have ANY direct performance impact at runtime, as includes are handled during compilation and don't remain as "includes" when compiled (if that makes sense). The actual code being used will ofcourse have an impact, but there is no additional load at all during run-time just for having includes.
Re: How many includes can I have? -
lNoobOnDutyl - 30.11.2017
Infinite i assume tho i read somewhere along the way that load order might impact the memory aloc (Don't quote me on this) but yeah many people use it to order their script so it doesn't become a mess.
Re: How many includes can I have? -
RageCraftLV - 30.11.2017
Thanks for the help!
Re: How many includes can I have? -
Kaperstone - 01.12.2017
Quote:
Originally Posted by Abagail
Includes themselves don't have ANY direct performance impact at runtime, as includes are handled during compilation and don't remain as "includes" when compiled (if that makes sense). The actual code being used will ofcourse have an impact, but there is no additional load at all during run-time just for having includes.
|
I actually doubt that it has zero performance impact on compilation at all, include after all needs to open a file and read it and the hooks & defines should be compiled as well.
It should have at least a very little performance impact on the compilation. (on modern setups)
I think pc's with an hdd running on a potato, the performance impact on compilation would be noticeable the most.