Page 1 of 1
Would it be more efficient?
Posted: 01 Aug 2007, 17:47
by Snipawolf
To just define the INBUILDSTANCE, and all that other juicy stuff in the thread, instead of compiling it with standard commands?
I feel it would be faster, at least a whee bit, because it doesn't have to check through that file, just the cob.
Posted: 01 Aug 2007, 18:02
by KDR_11k
#defines are precompiler statements, the string INBUILDSTANCE gets replaced with the number it's defined as before the compiler produces the bytecode.
Posted: 01 Aug 2007, 18:50
by Snipawolf
I know that...
Would it be more efficient to define it in my script, than to compile the standard commands along with it?
Posted: 01 Aug 2007, 18:58
by smoth
it only includes what it needs in the precompiling stage. Don't worry about that part.
defines are like a mini header... a define is nothing more then:
x=2
y=x+1
the compilers sees y=2+1
if you put x = 2 in the header it would be the same.
Posted: 01 Aug 2007, 19:40
by Snipawolf
Okay. So it reads my script, then it merely reads only what it needs. That's good, I like that way, much more efficient than using the whole thing.
Posted: 01 Aug 2007, 21:31
by KDR_11k
It doesn't even matter what it reads. In
#define x 1
#define y 2
z=1+x;
the second define would be looked at but since tghere are no ys in the text wouldn't do anything. Removing it would shorten the compile time slightly but if your COB takes more than a second or two to compile you're doing something seriously wrong anyway.