slow compile time
#1

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?
Reply
#2

What is the size of your file?
Reply
#3

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

Try downgrading back to the previous build.
Reply
#4

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.
Reply
#5

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

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.
Reply
#7

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.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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
Reply
#11

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)
Reply
#12

Thank you ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)