PAWN compilation time
#1

When projects grows, its compile time grows as well. The more macros and includes you have, the precompiler has more stuff to do.
I'm not sure how it works internally (no time and skills for full source analysis), but I think it's like
1. Precompiler pass
2. Second precompiler pass (reason ALS works)
3. Standard compilation

I'm currently working on a already existing project, it was previously a single file blob - after adding YSI libs, and modularizing it a bit the compile time went up ~60% (we are talking about minutes here)

Are there some methods which could slash down compilation time? I can think of some sevice mirroring minor changes in .pwn directly onto .lst file, or switching to C++ and composing GM from dll's, or more radical options - like implementing PAWN in a some kind of interpreted way (I have no idea if that'd be possible though), or rewriting pawncc in a more efficient way (but that's out of my skills scope).

I'm working on my trusty, but quite old notebook (dual core 2.1), so I'm quite certain that on decent CPU the times will be ~50% lower (I'm using highest priority for pawncc, with dedicated core 2 freezing it for a while), but still it'd be minutes.
Reply
#2

Quote:
Originally Posted by Misiur
Посмотреть сообщение
When projects grows, its compile time grows as well. The more macros and includes you have, the precompiler has more stuff to do.
I'm not sure how it works internally (no time and skills for full source analysis), but I think it's like
1. Precompiler pass
2. Second precompiler pass (reason ALS works)
3. Standard compilation

I'm currently working on a already existing project, it was previously a single file blob - after adding YSI libs, and modularizing it a bit the compile time went up ~60% (we are talking about minutes here)

Are there some methods which could slash down compilation time? I can think of some sevice mirroring minor changes in .pwn directly onto .lst file, or switching to C++ and composing GM from dll's, or more radical options - like implementing PAWN in a some kind of interpreted way (I have no idea if that'd be possible though), or rewriting pawncc in a more efficient way (but that's out of my skills scope).

I'm working on my trusty, but quite old notebook (dual core 2.1), so I'm quite certain that on decent CPU the times will be ~50% lower (I'm using highest priority for pawncc, with dedicated core 2 freezing it for a while), but still it'd be minutes.
How many lines is your gamemode?
Reply
#3

You probably got some really wierd defines and defines in defines. I guess if you cant optimize them, theres no way to speed it up.

A new compiler version could speed it up though, but as discussed so often its pretty tricky to update it for samp.
Reply
#4

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
You know amount of lines isn't the main reason why gamemodes take long to compile? I have a 250k (racing, many objects) line mode which compiles in 30 seconds and another 50k line mode (DM) which compiles in 3 minutes.
I'm asking due to the reason that you could have a lot of lines and causing inefficiency within the gamemode itself causing more compiling time.
Reply
#5

^ Seconded

I've done a lot of gamemodes, so starting with 1k lines (not so painful compile times), up to 350k (across files, but once had a single blob), with heavy use of macros and includes.
Reply
#6

The worst is using 3D arrays with MAX_PLAYERS and MAX_VEHICLES and what not. I don't think you can in any way reduce the time drastically, maybe only a few optimisations. Also, that's interesting, you said
Quote:
Originally Posted by Misiur
Посмотреть сообщение
and modularizing it a bit
Does the script being in a single file and being in modules give any difference in compile speeds?

EDIT: Argh, a minute late
Reply
#7

With complex macros I meant YSI's macros (like those detecting if next char is [, < or . LLVM looks cool, I'm playing with stacker example. I don't know how much time I'll have once I get back to day job, and I don't know if learning advanced applied C++ while writing the compiler is a good idea for project quality. I'll consider that though!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)