Page 1 of 1

"use" directive - using all the modules

Posted: Thu Nov 11, 2010 4:00 am
by andenixa
Is there any downside of using all the modules in every script?
In most of the complicated scripts it happens anyway through the link of chained includes.
Does using excess modules slow down the script?
Thank you.

Re: "use" directive - using all the modules

Posted: Thu Nov 11, 2010 9:06 am
by Tomi
apart from the npc modle, I see no problem using all the modules in scripts ( I do it already, because Im lazy to use them separate )

Re: "use" directive - using all the modules

Posted: Thu Nov 11, 2010 9:20 am
by Austin
If I remember right - in the core the module functions are matched up; It uses the module IDs in the script to limit the function pointer tables the core will look in.
If you have unnecessary modules used, it can cause an insignificant slow down.

Re: "use" directive - using all the modules

Posted: Fri Nov 12, 2010 11:00 pm
by andenixa
Thank you, I appreciate your help.

Re: "use" directive - using all the modules

Posted: Mon Nov 15, 2010 6:59 pm
by CWO
That's one thing I've always hated in the way my shard was originally written was includes using modules or including other files. While rewriting my shard I've enforced only allowing "use" and "include" inside the src file, not in any include files.

Re: "use" directive - using all the modules

Posted: Mon Nov 15, 2010 8:17 pm
by Austin
Ill check sometime.. its been a while since I looked at the core.
I do know during compile it wont use any functions in an include that were not called when it builds the ECL.
Not sure if it does the same for the use commands (ignore a use command if no function was called in it)