SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 29/11/2017, 08:07 PM   #1
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Default How many includes can I have?

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.
__________________
RageCraftLV is offline   Reply With Quote
Old 29/11/2017, 09:20 PM   #2
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 619
Reputation: 287
Default Re: How many includes can I have?

An include is just pawn code that is copied into your script on compilation.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 29/11/2017, 09:24 PM   #3
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,493
Reputation: 439
Default Re: How many includes can I have?

Quote:
Originally Posted by RageCraftLV View Post
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.
Abagail is offline   Reply With Quote
Old 30/11/2017, 02:01 AM   #4
lNoobOnDutyl
Little Clucker
 
lNoobOnDutyl's Avatar
 
Join Date: Nov 2017
Location: Netherlands
Posts: 34
Reputation: 0
Default Re: How many includes can I have?

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.
__________________
Notorious Roleplay



[OLD Work]

lNoobOnDutyl is offline   Reply With Quote
Old 30/11/2017, 06:33 AM   #5
RageCraftLV
Big Clucker
 
Join Date: Jun 2016
Location: Latvia <3
Posts: 55
Reputation: 4
Default Re: How many includes can I have?

Thanks for the help!
__________________
RageCraftLV is offline   Reply With Quote
Old 01/12/2017, 11:06 AM   #6
Kaperstone
Banned
 
Join Date: May 2011
Location: Russia
Posts: 3,346
Reputation: 824
Default Re: How many includes can I have?

Quote:
Originally Posted by Abagail View Post
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.
Kaperstone is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Includes TwisTa98 Everything and Nothing 2 07/12/2013 07:07 PM
help with #includes TwTJustin General 3 26/11/2013 11:17 PM
Includes BlueBaron Scripting Help 1 16/11/2013 07:51 PM
Includes edzis84 Scripting Help 3 16/07/2013 09:09 PM
About Includes ExEx General 4 25/11/2010 03:58 PM


All times are GMT. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.