SA-MP Forums

Go Back   SA-MP Forums > Other > Everything and Nothing

Reply
 
Thread Tools Display Modes
Old 31/01/2014, 10:18 AM   #1
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,526
Reputation: 554
Default PAWN compilation time

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.
Misiur is offline   Reply With Quote
Old 31/01/2014, 10:34 AM   #2
ViruZz
Banned
 
Join Date: Feb 2012
Location: Montreal
Posts: 320
Reputation: 56
Default Re: PAWN compilation time

Quote:
Originally Posted by Misiur View Post
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?
ViruZz is offline   Reply With Quote
Old 31/01/2014, 10:56 AM   #3
Mauzen
Banned
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,880
Reputation: 1597
Default Re: PAWN compilation time

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.
Mauzen is offline   Reply With Quote
Old 31/01/2014, 10:56 AM   #4
ViruZz
Banned
 
Join Date: Feb 2012
Location: Montreal
Posts: 320
Reputation: 56
Default Re: PAWN compilation time

Quote:
Originally Posted by Gamer_Z View Post
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.
ViruZz is offline   Reply With Quote
Old 31/01/2014, 11:50 AM   #5
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,526
Reputation: 554
Default Re: PAWN compilation time

^ 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.
Misiur is offline   Reply With Quote
Old 31/01/2014, 11:55 AM   #6
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,177
Reputation: 311
Default Re: PAWN compilation time

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 View Post
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
RajatPawar is offline   Reply With Quote
Old 31/01/2014, 03:44 PM   #7
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,526
Reputation: 554
Default Re: PAWN compilation time

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!
Misiur is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Vectoral Pawn - STL Data containers for pawn Rancho Plugin Development 69 25/03/2019 11:50 PM
Thoughts when you opened a pawn script for the very first time. xtr3mepWnaGe Everything and Nothing 65 09/11/2012 04:10 PM
[Tool/Web/Other] PAWN Scanner - Scan PAWN files for information. Slice Tools and Files 10 15/07/2012 07:09 PM
Compilation Twixer Server Support 2 13/02/2012 03:25 PM


All times are GMT. The time now is 12:13 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.