A Little Question about "Import.." stuff


(Bora Kasap) #1

I just wanna ask a question not about FP actually.

Sometimes, i have some entities and i need a little function from FP class “FP.distance” etc…

so, when i need something like that, should i import whole FP class inside everyclass?

Or is it better to use a global mirror function inside a global static class for FP.distance() and other little functions and using like GLOBALS.distance()?


(Ssnyder Coder) #2

Why are you asking this question? Are you concerned about whether importing large classes will impact performance? I did a quick Google search and there doesn’t seem to be any major performance issues from importing larger classes (well, perhaps extremely large classes). There is a slight impact on performance from using public static methods, but it is fairly insignificant in most cases.


(Bora Kasap) #3

actually i’m using a slow netbook computer and i just wanna increase compilation time for tests, instead of game performance…

thanks for the answer


(Ultima2876) #4

None of that kind of thing really affects compiling time in any meaningful way; the biggest factors that affect compile time are inclusion of large asset files and swfs (for music and sound usually).


(Jonathan Stoler) #5

Unless I’m misunderstanding you, you would need to import FP into your GLOBALS class anyway, so you wouldn’t be saving anything. (In fact this would technically be slower because you’re importing additional GLOBALS stuff too. Of course, none of this is measurable from a practical standpoint.)