SA-MP Forums Archive
slow compile time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: slow compile time (/showthread.php?tid=631028)



slow compile time - wallee - 21.03.2017

I started to use sublime text instead of pawno and i have code divided into sections, anyway when i include this one "section" the compile time jumps from 14 second to 46 seconds! The problematic sections is 154 lines only, has 2 defines, 1 enum, 3 forwards, 3 public functions, 1 timer (y_timers) and 3 commands ...

Anyone know what the problem could be?


Re: slow compile time - AndreiWow - 21.03.2017

What is the size of your file?


Re: slow compile time - Stones - 21.03.2017

A Lot of users have reported the latest sublime build has been causing issues.

Try downgrading back to the previous build.


Re: slow compile time - iLearner - 21.03.2017

Quote:
Originally Posted by Stones
Посмотреть сообщение
A Lot of users have reported the latest sublime build has been causing issues.

Try downgrading back to the previous build.
I agree, sublime text is taking kinda too much to compile.


Re: slow compile time - CJ101 - 22.03.2017

YSI slows down your compile time a lot, mainly because the libraries are so large.


Re: slow compile time - Runn3R - 22.03.2017

Quote:
Originally Posted by CJ101
Посмотреть сообщение
YSI slows down your compile time a lot, mainly because the libraries are so large.
Not just that, the thing about YSI libaries is that it's using too many macros and also lot of compiler hacks in order for libary to work. The compiler has to do a couple of rounds to compile all of the hack stuff and that is what the compiler makes so slow.


Re: slow compile time - JernejL - 23.03.2017

You can use pawncc with -l (listfile) to generate a .lst file, this will not compile, but will process all includes and #define-s.

This can be used to see how long just the pre-compile step takes, and if your includes & #defines are slowing down your compilation.


Re: slow compile time - Sithis - 23.03.2017

I don't see how Sublime text would slow down the compilation process. All it does is call the compiler when a hotkey is pressed.


Re: slow compile time - ISmokezU - 23.03.2017

A Script reads from the top to the bottom if you have a lot of coded lines, expect a long compiling time.

There you have it. That library's probably creating the problem.


Re: slow compile time - wallee - 22.05.2017

Sorry for bumping my old thread but i found the solution, the problem was my enum it was like this

Код:
enum ePlaData
{
	Float:plaHP,
	Float:plaArmz,
	plaKills = INVALID_SCORE,
	plaDeaths = INVALID_SCORE
};
I removed the red parts and the compile time went from 48 seconds to 2 seconds. Maybe someone who knows a bit more about pawn can tell me why? But even if i don't get a answer to that i'm still happy that i got this fixed :3


Re: slow compile time - Nero_3D - 22.05.2017

Quote:
Originally Posted by wallee
Посмотреть сообщение
Sorry for bumping my old thread but i found the solution, the problem was my enum it was like this

Код:
enum ePlaData
{
	Float:plaHP,
	Float:plaArmz,
	plaKills = INVALID_SCORE,
	plaDeaths = INVALID_SCORE
};
I removed the red parts and the compile time went from 48 seconds to 2 seconds. Maybe someone who knows a bit more about pawn can tell me why? But even if i don't get a answer to that i'm still happy that i got this fixed :3
First you need to know that an enum is a list of constants, starting at 0 and going up by 1 by default if not otherwise specified
PHP код:
enum ePlaData
{
    
Float:plaHP// 0
    
Float:plaArmz// 1
    
plaKills INVALID_SCORE// normally 2 but overwritten with INVALID_SCORE
    
plaDeaths INVALID_SCORE // also overwritten with INVALID_SCORE
}; 
The enum name will be the next value after the last constant, in this case with the default rule ( += 1 ) ePlaData will hold (INVALID_SCORE + 1)

Using ePlaData like that would create a (INVALID_SCORE + 1) sized array each time
To assign default values use the array initializer
PHP код:
new array[ePlaData] = { 0.00.0INVALID_SCOREINVALID_SCORE }; 
Reread the enum part in pawn-lang.pdf (page 101)


Re: slow compile time - wallee - 22.05.2017

Thank you ^^