"use" directive - using all the modules

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
User avatar
andenixa
Grandmaster Poster
Posts: 105
Joined: Tue Nov 09, 2010 1:33 am

"use" directive - using all the modules

Post 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.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: "use" directive - using all the modules

Post 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 )
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: "use" directive - using all the modules

Post 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.
User avatar
andenixa
Grandmaster Poster
Posts: 105
Joined: Tue Nov 09, 2010 1:33 am

Re: "use" directive - using all the modules

Post by andenixa »

Thank you, I appreciate your help.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: "use" directive - using all the modules

Post 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.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Re: "use" directive - using all the modules

Post 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)
Post Reply